A leading Iranian-American academic jailed in May during a visit to Tehran has told Iranian TV she is "very happy" after being freed on bail.
Haleh Esfandiari is one of the leading US authorities on Iran
Haleh Esfandiari, 67, who is accused of spying, was released for a bail of 3bn rial ($320,000; £160,000), the official state news agency Isna reported.
Ms Esfandiari, who works for a research institute in Washington, was jailed while visiting her 93-year-old mother.
State-run TV showed her emerging from prison in Tehran and meeting family.
Speaking in Farsi, Ms Esfandiari said: "I'm very happy. It was unexpected.
"They treated me very well in the section. I had a room. It was very big, it had a window. I could have air whenever I wanted. The food was very good.
"The women (warders) in that section were very pleasant. They were educated and behaved well."
A spokesman for the US National Security Council welcomed the academic's release, which comes amid ongoing tensions between the US and Iran.
Ms Esfandiari's husband, who is in the US, told the BBC he had spoken to his wife and she "sounded well".
Shaul Bakhash said: "She said briefly that she was treated well. She's eager to come back home and she hopes that they will give her her passport soon and allow her to come home."
In December, while on her way to the airport to return to the US, Ms Esfandiari's taxi was stopped by three men who stole her belongings, including her Iranian and US passports.
When she went to replace her passport, she was sent to the intelligence ministry, where she was repeatedly questioned about her work as the director of the Middle East Program at the Woodrow Wilson Centre in Washington.
In May, after being repeatedly prevented from leaving Iran, she was taken to the notorious Evin Prison in the Iranian capital.
Iranian media accused her of spying for the US and Israel.
The BBC's Pam O'Toole says the Iranian authorities appear highly suspicious of attempts by the Bush administration to promote democratic change in Iran.