POTOMAC, Maryland (CNN) -- To combat the depression and despair during her 105-day stint in Iran's notorious Evin prison, Haleh Esfandiari welcomed all distractions and blocked thoughts of her beloved home and family.
Haleh Esfandiari talks to Iranian media in front of Evin prison after her August 21 release.
The Iranian-American scholar, who was charged with espionage and endangering Iranian national security during a December visit to her family, wrote a book in her mind, read newspapers, watched television and exercised voraciously.
"I decided either I am going to succumb to despair or I am going to try to make the best of this condition, and the best of this condition was to have a disciplined day," she said. "So I would exercise for many hours, I would read, I would walk a lot, some three to four hours a day -- even in the room, you know, I would pace up and down timing myself."
The 67-year-old grandmother of two said dwelling on her incarceration, and longing for her family, was disheartening "so that's why I plunged into exercising, and I wrote a book in my mind on the history and life story of my grandmother. As I would be walking, I would write chapters and edit them in my mind and rewrite it the next day." Watch an 'elated' Esfandiari explain how she passed the time »
Esfandiari said she was treated "with respect" while at Evin, but added, "A prison is a prison."
Esfandiari was allowed to go home last week. She returned to Potomac, Maryland, on Thursday and discussed her arrest and captivity during a Saturday interview.
Though she said she's unsure why she was jailed in Evin's political wing, Esfandiari believes her Iranian captors wanted to know more about the Woodrow Wilson Center for International Scholars, the Washington-based think tank where she heads the Middle East program.
"I think they were trying to found out more about the Wilson Center -- what it really does, were trying to find out about think tanks in America, foundations in America, the relationship between think tanks, foundations and the government," she said.
On December 21, the dual Iranian-American national traveled to Iran to visit her 93-year-old mother, where she visited for nine days. On December 30, she caught a taxi to the airport where she planned to fly home to Washington.
Those plans were altered by three knife-wielding men who stopped her cab, threatened to kill her and stole her luggage and handbag, which contained both of her passports and her airline ticket.
Esfandiari called her husband, Shaul Bakhash, back home in Maryland and told him to cancel her credit cards and report the stolen passport. The next day, she went to the authorities.
"I went to the passport office, and they said that they would like to, somebody wants to talk to you. And that was the beginning of the saga," she said.
That somebody, according to the Wilson Center, was an official with Iran's Ministry of Intelligence.
Beginning on January 4, Esfandiari was subjected to weeks of interrogations, sometimes as many as four a week and some lasting as long as eight hours, according to the Wilson Center. The questioning, the center said, was "unpleasant and not free from intimidation and threat."
She was pressured to make confessions and falsely implicate the Wilson Center. She once received a threatening phone call. On January 18, she awoke from a nap at her mother's home to find her interrogator and two men -- one of them wielding a video camera -- staring into her bedroom, the Wilson Center said.
On February 17, the interrogations stopped, but in late April or early May she again began receiving phone calls from the Iranian government. On May 7, she was asked to go to the Ministry of Intelligence the following morning, according to the Wilson Center.
When she arrived, she was put in a car and taken to Evin prison. Over the next two weeks, Iranian media reported that Esfandiari was accused of trying to topple the Iranian government.
Later that month, a judiciary spokesperson announced that she was charged with espionage, actions against national security and propaganda against the Islamic republic.
"It was puzzling for me at first," Esfandiari told CNN. "I think there is a concern among certain elements that the United States has planned some kind of Velvet Revolution in Iran, and since they are bogged down in Iraq and Afghanistan, they won't do it through military. They would do [it] through think tanks and foundations to create a network of people to undermine the regime. I think that is their concern."
The Velvet Revolution is the name given to the 1989 bloodless coup that saw Czechoslovakia's communist regime overthrown.
In prison, Esfandiari was interviewed for an Iranian state television documentary, in which she allegedly linked U.S. think tanks and nongovernmental organizations with a "soft revolution" against the Iranian government.
The Wilson Center quickly denounced the documentary as "scripted, contrived, and completely without merit."
The center's president and director, Lee Hamilton, who has served on the 9/11 Commission and Iraq Study Group, also issued a statement, saying the documentary took "the fabrication of news to a new art form. This is shameful. It cannot be considered a 'confession' by any stretch of the imagination."
Hamilton had written letters to President Mahmoud Ahmadinejad and Majlis Speaker Shouray-e-Islami, to no avail. On June 29, he wrote another letter to Grand Ayatollah Ali Khamenei, the supreme leader of Iran, pleading for his help in Esfandiari's case.
A week later, the former congressman met in New York with Iran's representative to the U.N., who delivered a written response from Khamenei. The letter, which "was positive and conveyed respect," marked the first time the ayatollah had responded to an American leader, according to the Wilson Center.
Esfandiari said she believes she owes her freedom, in part, to Hamilton's letter. The Iranian government never said why Esfandiari was allowed to go home, but on August 21 she was released on a bail of 3 billion Iranian rials ($320,000).
Esfandiari picked up her passport September 1 and flew to Vienna, Austria, where her sister lives, the next day. She arrived in the United States on Thursday.
"The first thing I did, I walked around, walked into the kitchen and started looking at things and say, 'OK, where is this? This shouldn't be here! That shouldn't be there!' " she said. "And Shaul goes, 'There she goes again.' "
Esfandiari said she is "elated to be home."
"Sleeping in my own bed after eight months, taking a shower in my own bathroom after eight months, walking around the garden," she said. "To see my grandchildren who have grown since I last saw them in those eight months. So it is a fantastic -- it is a fantastic feeling -- and looking back, I am glad this nightmare is over." E-mail to a friend