Joshua Fattal, center, with fellow detainees Shane Bauer, left, and Sarah Shourd in Tehran in 2010. Fattal, released in 2011, said he lost his keys to his first post-captivity apartment. “I wasn’t allowed to touch keys for a long time,” he explained. (REUTERS)

It’s a long trip from Tehran, but it won’t really end when three Americans released from Iranian prisons over the weekend touch down in the United States. It may be months before they can reclaim the freedom to live an ordinary life, before they feel as if they are truly at home again.

Journalists, diplomats and others who have been held overseas have suffered sleeplessness, nightmares and illnesses induced by their imprisonment.

They have confronted the inevitable choices about whether to seek privacy or accept publicity. For the prisoners released Saturday, those questions will be complicated by a heated presidential campaign.

And then there are the little things. Joshua Fattal, an American who was arrested by Iranian officials while hiking near the border between Iraq and Iran and who spent two years in captivity, recalled moving into his first apartment after his release in 2011. He promptly lost his keys. “I wasn’t allowed to touch keys for a long time,” he explained.

How individuals respond to captivity varies widely, said Frank Ochberg, a psychiatrist at Michigan State University and a leading figure in research on traumatic stress.

A gate at the U.S. military medical center in Landstuhl, Germany, moments after Washington Post correspondent Jason Rezaian and two other Americans landed at Ramstein Air Base on Sunday. (Jabin Botsford/The Washington Post)

“I don’t think we really know why one person is more emotionally and physically resilient than somebody else,” he said.

For those leaving prison, a comprehensive medical checkup is crucial, Ochberg said. Poor nutrition, unsanitary conditions and environmental toxins in prison can combine with stress to produce or exacerbate a range of medical conditions, such as diabetes, infections, thyroid disorders, circulatory problems, multiple sclerosis and Crohn’s disease.

Three of the American prisoners leaving Iran — Jason Rezaian, a correspondent for The Washington Post; Saeed Abedini, an evangelical pastor; and Amir Hekmati, a former Marine — arrived in Germany on Sunday afternoon, where they were receiving medical attention at a U.S. military hospital. A fourth prisoner, student Matt Trevithick, was released and left the country separately.

A fifth American, Nosratollah ­Khosravi-Roodsari, was also released but chose to remain in Iran.

In general, Ochberg said, seeing a psychologist isn’t always necessary, especially for the former prisoners who have family and close friends to return to and a sense of purpose in their professional lives.

That isn’t to say that acclimating to freedom is easy. Roxana Saberi, a journalist imprisoned in Iran in 2009, had a habit of looking over her shoulder when she first returned to the United States.

Washington Post journalist Jason Rezaian has been freed from prison, according to U.S. and Iranian officials. He was arrested in Iran in 2014 and convicted of espionage last year. Here's what you need to know about the case against him. (Monica Akhtar/The Washington Post)

While she was in prison, the Iranians had demanded that she spy for them once she was released. It took her some time to shake the feeling that they would kidnap her and imprison her again because she was not cooperating. “Those captors were very good at putting that fear in my head, that they could find me wherever I was,” Saberi said. “It’s not a fear that’s based in reality. It’s just that some of those fears are, kind of, ingrained in my psyche.”

Like Rezaian, Saberi had been living and reporting in Iran when she was arrested, accused of espionage and locked up in Evin Prison. An appellate court ordered her release, and she was freed after spending 100 days in captivity.

Back at home, she couldn’t sleep at times. “I had nightmares that people were coming for me, because I was taken from my apartment in Tehran,” she said.

“Those nightmares are very rare now,” she added. “It took me probably a good two years to feel like I was really in a good place.”

Saberi chose to share her ordeal with the public. “I tried to focus on writing about my experiences and talking about my cellmates I had left behind,” she said. “It gave me a sense of purpose.”

For others, the notoriety is disorienting. Fattal often felt as though people in the United States saw him only as a symbol in the political controversy surrounding Iran, not a human being.

“People have such strong opinions about the politics, where as a prisoner, that’s your life,” he said. It was strange to find “everyone arguing about you and what you mean,” he added. “You just want to kind of get your feet on the ground and figure things out again.”

That discomfort might be even more pronounced for Rezaian, Abedini and Hekmati, who are returning to the United States during a presidential campaign in which candidates on both sides of the debate about Iran probably will invoke their names and their stories in support of their positions.

Fattal predicted that Democratic and Republican candidates alike will point to what Rezaian suffered behind bars to show that Iran can’t be trusted.

Rezaian, a journalist, will have a chance to write about his incarceration and set the terms of the debate over the episode himself.

“He will have to make a decision about how soon he wants to be public, how much he wants to say that could be private and intimate,” said Ochberg, the psychiatrist. “There are definitely people who are going to be curious.”

For now, all that is still in the future, and Rezaian and his fellow former prisoners can enjoy their freedom.

“Initially, it’s absolutely fantastic,” said David Rohde, an investigative journalist for Reuters. The Taliban kidnapped Rohde in Afghanistan in 2008 while he was reporting for the New York Times. He escaped after seven months in captivity.

“You’re not locked in a room. You eat when you want. You hug your loved ones when you want,” Rohde added. “Whatever difficulties you face, it’s so much better than being there.”