Leading Iranian dissident Hashem Aghajari, who spent two years in jail facing the death penalty for blasphemy, has been freed on bail.
Aghajari (left) has repeatedly urged democratic reform in Iran
Mr Aghajari, 47, was sentenced to hang in 2002 after he urged people not to follow their religious leaders blindly.
That verdict provoked the biggest student protests in years, forcing Iran's supreme leader Ayatollah Khamenei to order a review.
At his second retrial earlier in July, Mr Aghajari was given a five-year term.
The Supreme Court will now rule on how much of time Mr Aghajari must serve out, taking into account the time already spent behind bars.
"I hope there will come a day when no-one goes to prison in Iran for his opinions, let alone be sentenced to death," Mr Aghajari said, barely holding back his tears on arrival back at his home in north Tehran.
Ayatollah Khamenei was forced to act in the face of protests
"I hope that all prisoners of conscience who have committed no crime will be released soon," he said, defying an order to stay silent.
His family and neighbours handed out sweets and fruit juice to celebrate his freedom.
"Finally my dad is free," said his daughter Maryam, while his wife, Zahra Behnoudi, expressed her joy at his release while adding, "I would rather he had been acquitted."
A reformist friend had posted the bail of 970m rials ($113,000), while more than 160 well-wishers, including academics and clerics, had offered to contribute, Mr Aghajari's lawyer said.
Mr Aghajari, a history professor at a Tehran college, made a speech in August 2002, which was a seen as an attack on the country's Islamic establishment and led to his being charged with blasphemy and apostasy.
He said that Muslims were not "monkeys" and "should not blindly follow" the clerics.
An emotional reunion for Mr Aghajari and his wife
After student protests, Ayatollah Khamenei was forced to step in and order a retrial.
During his trials, Mr Aghajari called for democratic reform, telling the court he stood for "an Islam that brings about freedom and is compatible with democracy and human rights."
He is a war veteran who lost a leg in the 1980-88 war with Iraq. He belongs to a left-wing reformist political group, the Islamic Revolutionary Mujahidin Organisation.