WASHINGTON (CNN) -- American Haleh Esfandiari -- arrested nearly four months ago by Tehran officials on charges of harming national security -- was released Tuesday from an Iranian prison after her mother posted bail, her family said.

Haleh Esfandiari is seen in an image captured from Iranian television in July.

"I'm very happy. I mean, it was very unexpected," Esfandiari said in an interview on Iran's state-run IRINN TV.

Esfandiari's husband, Shaul Bakhash, said Esfandiari's mother, who lives in Tehran, received a call from Iranian authorities telling her to post bail of $330,000, which she did.

As is typical in Iran, the bail was secured by the deed to the mother's apartment, he said.

A cousin went to the prison to meet Esfandiari, and family members said she had returned to her mother's home.

Bakhash said he had spoken to his wife and that she "sounds well," though other family members described her as tired. She appeared gaunt on Iranian television. Watch Esfandiari smiling on Iranian TV »

Bakhash said his wife told him she had been "treated well," but that the Iranians had misconceptions about the Washington-based Woodrow Wilson Center for International Scholars, where the 67-year-old directs the Middle Eastern program.

"I am absolutely delighted that she is out and happy to hear her voice after nearly four months," Bakhash told CNN.

He said his wife is free to move around Tehran and she hopes that Iranian authorities will soon clarify her situation. Bakhash said Esfandiari was looking forward to getting her passport back.

He said she sounded "very positive and upbeat," and hopeful that she will be able to leave soon.

He said she learned of her release Tuesday at 5 p.m. (9:30 a.m. ET), when her "interrogator" visited her in prison and told her she was free to go.

"You must be joking," Bakhash said she told him.

The interrogator then said arrangements had already been made for her bail to be paid and that her mother was en route to pick her up.

"I'm elated," Bakhash said several hours after receiving the news. "It took a while for all of this to sink in."

Though Esfandiari sounded good, she told him she had been ill and mentioned a skin rash and eye inflammation, Bakhash said.

Bakhash, who is a professor specializing in Middle-Eastern affairs at the University of Maryland, added that he had been withholding his emotions until now.

Once his wife is allowed to leave the country, she may stop first in Austria, where her sister lives, prior to returning to the United States, he said.

White House spokesman Gordon Johndroe said, "The U.S. welcomes the news." The U.S. has criticized Iran for holding Esfandiari and three other Americans.

However, U.S. officials also said they saw Esfandiari's release as a "half-gesture" and are concerned they will still keep her in Iran.

U.S. officials said Iran is trying to show a "more reasonable and rational" face in advance of an upcoming U.N. General Assembly session.

Don't Miss

Esfandiari, 67, was arrested as she was in Iran visiting her ailing mother, who is in her 90s.

Former U.S. Rep. Lee Hamilton, the director of the Wilson Center, said it is unclear what the future holds. He said the charges against Esfandiari have not been dismissed.

However, he said her family and her co-workers were relieved that her time in prison was at an end.

"We're rejoicing because a long and trying ordeal for her and her family is over," said Hamilton.

"Her physical and mental welfare are the urgent priority. We want her to be permitted to return to the United States and her family. She lost eight months of her life. She went through long hours of interrogation and isolation that we can't imagine. She was under a great deal of stress and lost a lot of weight."

Hamilton said he had recently written to the Iranian supreme leader, the Ayatollah Sayed Ali Khamenei, and that Khamenei had sent back a rare response.

Hamilton said he had appealed in his letter for Khamenei to aid Esfandiari for religious and humanitarian reasons, saying she had tirelessly tried to explain Iran's culture and its people.

In response, he received a two-paragraph, unsigned response from the ayatollah's office, he said.

In it, Khamenei said he was pleased by the commitment to peace and justice expressed in Hamilton's letter and was hopeful there would be "a change in the attitude of the oppressed people of the region toward the United States."

Hamilton said the letter informed him that Khamenei had given instructions to "deal with this issue" and that "necessary measures will be taken as soon as possible."

Hamilton said he had also been in touch on several occasions with Iran's permanent representative at the United Nations.

In July, Iranian television aired a documentary that included Esfandiari and another jailed American appearing to confess that they had participated in U.S. efforts to undermine the Iranian government.

Iran's IRIB television network aired the program, "In the Name of Democracy," which featured Esfandiari and urban planning consultant Kian Tajbakhsh, both of whom were arrested by Iranian authorities in May.

They were charged with trying to topple the government.

"Now that I've been in Iran for the last five months, and I've been thinking and talking, I've reached the conclusion that these people, including myself, were like the links in a chain made up of foundations, research institutes and universities that, under the name of democracy and empowering women and in the name of dialogue, tried to create networks," she said on the program.

"And ultimately they would have led to many fundamental changes in Iran within the regime and would have shaken the system."

Esfandiari's daughter and husband condemned the program, saying her remarks were scripted.

The other two detainees are Parnaz Azima, a reporter for the Persian-language service of Radio Free Europe who holds both Iranian and American citizenship; and Ali Shakeri, a businessman who was arrested in March while on a visit to his aged mother, who subsequently died, according to the Center for Citizen Peacebuilding at the University of California, Irvine, where Shakeri is an adviser.