Bahman Daroshafaei, who has dual British and Iranian citizenship, was arrested at his home in Tehran on 3 February on unspecified charges.
One friend told the Reuters news agency that his release on Tuesday "was a surprise to him".
Mr Daroshafaei has been working as a translator since leaving BBC Persian around two years ago.
His family said that his passport had been seized after he returned to Iran.
Since then, he had been questioned dozens of times by the intelligence ministry about his activities as a journalist, the news website Iranwire reported.
A Twitter campaign run by his friends and colleagues, @FreeBahman, posted a photograph of Mr Daroshafaei standing outside Tehran's Evin prison on Tuesday.
"Good news: Bahman has been released on bail," said the caption.
In November, two prominent journalists were arrested as part of what appeared to be a crackdown on writers, artists and other cultural figures in Iran. Isa Saharkhiz and Ehsun Mazandarani have been accused of acting against national security.
The previous month, poets Fatemeh Ekhtesari and Mehdi Mousavi and filmmaker Keywan Karimi were handed lengthy prison terms by a court after being convicted of charges including "insulting sanctities and propaganda against the state".
A former BBC Persian journalist detained in Iran has been released from prison on bail, his friends say.