Iran Prisoner Swap: Inside the Frantic Final Moments

New details are emerging about the tense moments before the American left Iran.

ByABC News
January 18, 2016, 3:57 PM

— -- New details are emerging about those tense moments before the plane carrying three American prisoners took off from a military base in Iran -- and how a frantic phone call between senior U.S. and Iranian leadership had to be made to ensure the Americans' release.

“We thought it was a done deal,” an official who was with Secretary of State John Kerry this weekend in Geneva, Switzerland told ABC. The official said the secretary had been assured the plane was almost “wheels up,” before they learned of the latest snag in their months-long diplomatic efforts.

A nerve-wracking scene was unfolding at the Iranian military base in Tehran for Washington Post journalist Jason Rezaian, who had just been released from 545 days of detention at Iran's notorious Evin prison. The agreement was that he and his wife, Yeganeh Salehi, 31, an Iranian journalist who had also spent time detained in Iran, would be allowed to travel out of the country with him. But Iranian military officials insisted she was not on the manifest, a clerical error the official said threatened to derail the process for Jason and his family.

Kerry quickly made another call to Iranian Foreign Minister Javad Zarif to settle the issue. Kerry told Zarif that Salehi's passage had always been part of the agreement. "Then it took a while," this official said, leaving them to wondering nervously if she would make it on the plane. Eventually she was allowed on and the plane got underway early in the morning eastern time, more than 12 hours after news of their release had broke.

US Special Envoy in the war against ISIS, Brett McGurk, met Jason and the other Americans at the airport in Geneva when the plane landed.

Salehi, along with Jason's mother Mary Rezaian, had been tireless advocates for his release.

It was enormous relief for the Rezaian family. "I'm just happy to have my brother home," Ali Rezaian, Jason's brother, told “Good Morning America” today.

Get real-time updates as this story unfolds. To start, just "star" this story in ABC News' phone app. Download ABC News for iPhone here or ABC News for Android here.