In fact, it almost fell apart many times along the way -- including the very night the plane was set to take off.
U.S. diplomat Brett McGurk spoke with CNN about the 14-month secret negotiations he undertook to eventually secure the release of Washington Post reporter Jason Rezaian, former Marine Amir Hekmati, pastor Saeed Abedini and Nosratollah Khosravi-Roodsari over the weekend.
Diplomats involved in the negotiations have pointed to the urgency of the Americans' cases, including fears that Jason Rezaian faced punishments ranging from 10 to 20 years in prison to the possibility of a death sentence.
McGurk, in his rare interview providing an inside look at sensitive negotiations, details a divided Iran and an arduous process for the U.S. to navigate the maze of gatekeepers in the Iranian government to bring the Americans home.
That includes even the evening the group was set to get on a Swiss plane to finally leave Iran overnight Saturday -- and it was discovered that Rezaian's wife and mother were missing.
"It was actually very concerning so we stopped the whole thing," said McGurk, the special presidential envoy for fighting ISIS.
Bringing back Mary Rezaian, Jason's mother, and Yeganeh Salehi, his wife, was "part of the deal, period," McGurk said, and so when the Iranians attempted to push through the swap without them, the U.S. was prepared to kill the deal.
"They recommended late that night that we execute the arrangement without Jason's mother and wife, and of course I said, 'No, the entire thing's off unless they're on the airplane.' "
For four or five hours, the women couldn't be found. McGurk said it's still unknown what the snag was and whether they were being intentionally hidden. But McGurk and others worked one part of the Iranian government while Secretary of State John Kerry contacted his counterpart, Foreign Minister Mohammad Javad Zarif, to try to resolve the situation.
The women were in a military wing of the airport in Tehran without their phones, McGurk said, so they couldn't be reached.
The U.S. still doesn't know who or what was behind it all.
"It's unclear," McGurk said. "There's a lot of people in the Iranian system, and the people who hold the keys to the prison cells, that never wanted this to happen."
Eventually, McGurk reached Mary Rezaian by phone and told her to stay put. Later, he recalled being on the phone with Swiss Ambassador to Iran Giulio Haas on the tarmac as he narrated one by one the Rezaians and other Americans filing out of a van and onto the plane.
That "was the key moment for us, and that was kind of the trigger for us," McGurk said. "I'll never forget his voice in my ear. It was the culmination point of a long time."
A divided Iran
McGurk painted a picture of a divided Iran, in which different factions of the government work in opposition to each other.
The conversations to release the prisoners began in the talks about the landmark nuclear deal signed with Iran, but McGurk said those negotiators realized they were working with the wrong power brokers.
"Undersecretary (Wendy) Sherman and Secretary Kerry would raise the American citizen cases almost every chance they could, but it became clear that to make progress we'd have to open a parallel channel with people in the Iranian system who could make decisions, the people who could actually make prison keys turn," McGurk said. "That was a different element to the Iranian system than the nuclear track."
The diplomat pointed to another moment when the talks nearly failed, which Kerry has alluded to in recent interviews as well. Kerry and McGurk joined up in Vienna, Austria, during other negotiations to talk to Zarif about the prisoner deal.
Their meeting was captured in a photograph released by the State Department, which at the time raised eyebrows because McGurk's connection to Iran was secret.
A reporter asked the State Department spokesman about it in a briefing in October, saying: "I believe his title is 'Special Envoy for the Fight Against ISIL and Extremism.' So why would he -- why would the secretary bring him to a meeting about the Iran nuclear deal?" according to a transcript
Spokesman John Kirby said Syria was not discussed, but did not explain at the time why McGurk was there.
On Tuesday, McGurk said that at that meeting, he and Kerry made "a lot of progress with Zarif."
"But then when I got back together with my counterparts, we kind of went back to square one and the whole process broke down," McGurk said. "They came back to us to restart it."
He added: "We had a lot of backs and forths here, so you can make progress with one person and then it can get rolled back."
Part of the issue is that Iran is in turmoil over what its future should be, he said.
"There's a real competition within Tehran, which is ongoing now, the country is undergoing some serious changes and having a debate with itself about its own future, so that's playing out right now," McGurk said. "That also plays into every issue in which we deal with the Iranians."
Critics, including several GOP presidential candidates, continue to criticize the prisoner swap, saying it will encourage Iran and other countries to take Americans hostage. But those involved in the exchange have stressed the urgency of getting the prisoners released.
McGurk wouldn't say whether the Americans had been tortured, saying the government was giving them time to "transition" back to freedom and that the individuals can tell their story when they feel the time is right.
But he noted that all were kept in prison cells for years and Hekmati had been given a death sentence, Abedini a decade, and Rezaian's potential fate was being decided.
"That alone is psychological manipulation at the very least," McGurk said.
McGurk said negotiators also continue to emphasize the importance of finding out what happened to former FBI agent Robert Levinson, who went missing from Iran in 2007.
Iran has agreed to cooperate in that effort, he added.
But the U.S. believes Levinson may no longer be in Iran.
"If this was a situation in which we knew Bob Levinson was in a prison cell in Iran, we'd have a different outcome here," McGurk said. "In fact it appears that he's not being held in Iran."
McGurk wouldn't say whether officials believe Levinson is still alive.
"We're not going to rest until we find out what happened and we secure his safe return, and so that remains what we try to do every single day," McGurk said. "We're not going to quit until we find out."