Iran has freed Washington Post journalist Jason Rezaian, according to Iranian news media. 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)

The United States and Iran moved into a new era of international relations Saturday, with the implementation of a landmark agreement on Iran’s nuclear program on a drama-filled day that also saw the release of imprisoned Washington Post reporter Jason Rezaian and four other Americans.

U.S. and European officials lifted the harshest economic sanctions against Tehran after the United Nations’ nuclear watchdog certified that the Islamic republic had fully complied with promises to curtail key parts of its nuclear program. Hours before diplomats in the Austrian capital hailed the official activation of the nuclear deal, Iran confirmed the release of Rezaian and the other American detainees, set free in exchange for U.S. clemency offered to seven Iranians charged or imprisoned for sanctions violations and the dismissal of outstanding charges against 14 Iranians outside the United States.

Rezaian and two other released Americans were flown out of Tehran on Sunday, after a delay. They were expected to go to Switzerland, then to a U.S. military facility in Germany to be examined by medical personnel. One of the Americans, Nosratollah ­Khosravi-Roodsari, did not fly out with the others, U.S. officials said.

“We can confirm that our detained U.S. citizens have been released and that those who wished to depart Iran have left,” a senior administration official said. “We have no further information to share at this time and would ask that everyone respect the privacy of these individuals and their families.”

The coordinated moves cemented a major diplomatic victory for the Obama administration, which won significant nuclear concessions from Iran in an effort to defuse an international crisis that threatened to spark a new Middle East war. The agreement also frees Iran from crippling economic sanctions and opens the way for ending decades of diplomatic and economic isolation.

“This evening, we are really reminded once again of diplomacy’s power to tackle significant challenges,” Secretary of State John F. Kerry said after the implementation was announced. “We have approached this challenge with the firm belief that exhausting diplomacy before choosing war is an imperative. And we believe that today marks the benefits of that choice.”

But the agreement also contains significant political risk for a White House that is staking its legacy on Iran’s willingness to comply with unprecedented curbs and extensive monitoring of its nuclear program. The pact — which has been repeatedly condemned by the Israeli government as well as by members of Congress from both parties — drew fresh attacks Saturday from Republican presidential contenders, some of whom blasted the deal as a sellout to Iran’s clerical rulers.

The nuclear pact calls on Iran to dismantle key nuclear equipment in a deal designed to ensure that Iranian officials could never accumulate enough fissile material to build a nuclear bomb. The agreement also requires unprecedented inspections and monitoring covering all aspects of Iran’s nuclear program, from uranium mining to research facilities.

Iranian Foreign Minister Mohammad Javad Zarif echoed Kerry’s remarks, saying on Twitter that “diplomacy requires patience, but we all know that it sure beats the alternatives.” Implementation of the deal, Zarif said, meant that “it’s now time for all — especially Muslim nations — to join hands and rid the world of violent extremism. Iran is ready.”

The release of prisoners had not been officially part of negotiations between Iran and the six world powers: the United States, Russia, China, Britain, France and Germany. But Kerry frequently raised the plight of imprisoned U.S. citizens during last year’s nuclear talks.

The Obama administration had come under heavy criticism for concluding the nuclear accord without winning the release of American detainees, including Rezaian, 39, whose 544-day detention is the longest ever by a Western journalist in Iran. White House officials confirmed that the swap was clinched during months of secret talks that gained momentum in the days before the nuclear pact was formally implemented.

Four Americans and seven Iranians were set to be exchanged in a deal linked to the imminent implementation of a landmark nuclear deal between Tehran and six world powers. Here's what we know about who they are. (Jason Aldag/The Washington Post)

“Friends and colleagues at The Washington Post are elated by the wonderful news that Jason Rezaian has been released from Evin Prison and has safely left the country with his wife, Yeganeh Salehi,” said Frederick J. Ryan Jr., publisher of The Post. “We are enormously grateful to all who played a role in securing his release. Our deep appreciation also goes to the many government leaders, journalists, human rights advocates and others around the world who have spoken out on Jason’s behalf and against the harsh confinement that was so wrongly imposed upon him,” he said.

“Now a free man, Jason will be reunited with his family, including his brother Ali, his most effective and tireless advocate. We look forward to the joyous occasion of welcoming him back to the Washington Post newsroom,” Ryan said.

Iran’s judiciary announced the release in Tehran as part of an exchange. The United States is releasing seven people charged with violating sanctions against Iran, U.S. and Iranian officials said.

A senior U.S. official said the “Iranians wanted a goodwill gesture” in response to the release of the Americans. A list of Iranians submitted to U.S. authorities was “whittled down” to exclude any crimes related to violence or terrorism, said the official, one of several who spoke on the condition of anonymity under administration ground rules.

Another official said the exchange was a “one-time arrangement because it was an opportunity to bring Americans home” and should not be considered something that would “encourage this behavior in the future” by Iran.

The officials did not tie the release directly to the nuclear talks and said they had not wanted the detained Americans to be “used as leverage” in the negotiations. But, they said, completion of the nuclear deal last July greatly accelerated talks about the prisoners.

In addition to Rezaian, the Americans freed Saturday included Saeed Abedini, 35, of Boise, Idaho; Amir Mirzaei Hekmati, 32, of Flint, Mich.; and Khosravi-Roodsari, U.S. and Iranian officials said.

A fifth American, identified as language student Matt Trevithick, was also released Saturday but was not part of the exchange deal. Trevithick’s parents said in a statement that he had been held for 40 days in Evin Prison. A senior U.S. official said Trevithick, 30, has already left Iran.

Abedini is a Christian pastor who had been imprisoned since July 2012 for organizing home churches. Hekmati is a former Marine who spent more than four years in prison on spying charges following his arrest in August 2011 during a visit to see his grandmother.

The detention of Khosravi-Roodsari had not been previously publicized. Iranian state television identified him as a businessman. Little else was known about him.

A senior administration official said of Trevithick, “We wanted him, obviously, to be a direct part of this, and made clear to Iranians that [his release] would be an appropriate humanitarian gesture.”

The exchange quickly became political fodder in the United States among Republicans vying for the GOP presidential nomination.

Republican front-runner Donald Trump said it was “a total disgrace” that the release of the Americans took so long. “This should have been done three, four years ago, when the [nuclear] deal was struck. Before the deal was made­ . . . they should have said, ‘We want our prisoners back,’ ” Trump said at a rally in New Hampshire.

New Jersey Gov. Chris Christie said in a television interview Saturday: “We’d be very happy for the families of the Americans who are going to be home and for those Americans, but I’d also want to hear what the other side of the deal is, if this president is releasing more terrorists from Guantanamo to go back and reenter the war on terror. . . . We shouldn’t have to swap prisoners. These folks were taken illegally in violation of international law, and they should have been released without condition.”

Rezaian’s ordeal damaged his health, drew protests from media and human rights groups, and hampered efforts to improve relations between Washington and Tehran. It also exposed fault lines and infighting in Iran’s opaque political system, where Rezaian and other detained Americans appeared to become pawns in a larger internal struggle between hard-liners and reformists seeking to improve ties with the West.

Rezaian was tried last year behind closed doors on vague charges of espionage and other alleged offenses and was sentenced to an unspecified prison term.

His 2014 arrest and subsequent trial and conviction in Iran’s secretive Revolutionary Court system — on charges that were never publicly disclosed or substantiated — appeared to reflect a power play by hard-liners fiercely loyal to Iran’s supreme leader, Ayatollah Ali Khamenei, against more moderate reformist elements under President Hassan Rouhani. The hard-liners control Iran’s security forces, intelligence apparatus, judiciary and most other levers of power, while Rouhani — though answerable to Khamenei — has been given relatively free rein to manage Iran’s foreign affairs and improve its economy.

In recent weeks, Iran took significant steps to meet its obligations under the deal.

Increased U.S.-Iranian cooperation appeared to be on display Wednesday when Iran released 10 U.S. sailors within a day after they were seized by Iranian Revolutionary Guard Corps naval forces in the Persian Gulf. The Americans were on two small riverine boats that strayed into Iranian waters.

Against this backdrop, the signs of rapprochement raised hopes for a resolution in Rezaian’s case.

Rezaian was arrested along with his wife when security forces raided their home July 22, 2014. Yeganeh Salehi, 31, a journalist who worked for the Abu Dhabi newspaper the National, was released on bail in October, but Rezaian languished in Evin Prison for months without trial or even specific charges.

Rezaian holds both U.S. and Iranian citizenship. But Iran, which does not recognize dual nationality, barred any U.S. role in the case, including consular visits by Swiss diplomats representing U.S. interests. Diplomatic relations between Washington and Tehran were severed in 1980 during the Iranian hostage crisis.

The last of four Revolutionary Court sessions was held in August, but it was not until October that a court spokesman announced a conviction — without providing any details. In November, the court said Rezaian was sentenced to a prison term, again with no elaboration.

In the meantime, Iranian officials floated the idea of a prisoner swap with the United States. Rouhani even suggested that Tehran could free Rezaian and at least two other Iranian American prisoners if Washington reciprocated by releasing 19 Iranian citizens convicted in the United States of circumventing sanctions.

As if to buttress that proposal, state-run news media in Iran then reported that Rezaian was accused of “spying on Iran’s nuclear programs” and giving the U.S. government information on people and companies evading sanctions.

Branigin, DeYoung and Warrick reported from Washington. Ellen Nakashima, Julie Tate and Ariana Cha contributed to this report.

Read more:

The ordeal of Post reporter Jason Rezaian

Jailed Washington Post correspondent has Christmas meal with family

Sketchbook: Jason Rezaian marks a year behind the bars of injustice

The Post’s coverage on Jason Rezaian