"I'm happy that the judiciary and the Islamic revolutionary court finally accepted the law and released my client on bail," Ebadi said.

Shaul Bakhash, Esfandiari's husband, said that Fanny Esfandiari, Haleh's mother, had used the deed to her Tehran flat to post bail.

"I feel extremely good. It has been a very anxious several months. Now we hope she will not only be released from prison but allowed to come back home," Bakhash said from his home in Potomac, Maryland.

Ebadi said Esfandiari was now legally allowed to leave Iran.

Interrogated

Esfandiari is director of the Middle East programme at the US-based Woodrow Wilson international centre for scholars, which describes itself as a non-partisan organisation dedicated to the study of domestic and international affairs.

"The gentlemen that I had contact with regarding interrogation were extraodinary, polite and respectful"

Haleh Esfandiari
It said that three masked men holding knives threatened to kill Esfandiari on December 30 as she was her way to Tehran airport after visiting her 93-year-old mother. 

They took her baggage, including her US and Iranian passports and, for several weeks, she was interrogated for up to eight hours a day.
 
Most of the questioning focused on the activities of its Middle East programme, the centre said.

As she left the prison, Esfandiari praised the staff and her treatment, even during the interrogations.
   
"The gentlemen that I had contact with regarding interrogation were extraordinary, polite and respectful," she said.

"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."

Iran confirmed in May that it had detained Esfandiari and charged her later that month.

Video broadcast

Last month, Iranian public television broadcast a video in which Esfandiari said a network of foreign activists was trying to destabilise Iran and bring about "essential" social change.

The video also featured Kian Tajbakhsh, an Iranian-American urban planning consultant with the Soros foundation's open society institute.

Both the Wilson centre and the New York-based institute have criticised the Iranian government for the broadcast and dismissed the statements as "coerced."

Hassan Hadad, Tehran's deputy prosecutor, told the Mehr news agency on Tuesday that the investigation into Esfandiari and Tajbakhsh was not over, although no charges had been issued.

The Iranian intelligence ministry has accused Esfandiari of trying to set up networks with the ultimate goal of creating a "soft revolution" in Iran, along the lines of the revolutions that ended communist rule in eastern Europe.