On Saturday, Iran and Sweden exchanged prisoners. The swap had the appearance of any two countries engaged in diplomatic negotiations to free their citizens. Families were elated; governments were relieved.

But the exchange was only the latest chapter in Iran’s long history of what is known in world affairs as hostage diplomacy.

For more than four decades, since the 1979 revolution that installed a conservative theocracy, the country has made the detention of foreign and dual nationals central to its foreign policy. For Iran, the approach has paid off. For the world, it has been a troubling trend.

Iran’s demands have evolved along with its tactics. In exchange for releasing foreigners it has asked for prisoners, assassins, cash and frozen funds. It has engineered complex deals involving multiple countries. And on Saturday Iran gained the release of its most prized target: the first Iranian official to be convicted of crimes against humanity.

In the exchange, Sweden released Hamid Nouri, a former judiciary official who was serving a life sentence in Sweden for his role in the mass execution of 5,000 dissidents in 1988.

In return, Iran freed two Swedish citizens — Johan Floderus, a diplomat for the European Union, and Saeed Azizi, a dual national Iranian. A third, a Swedish dual national scientist, Ahmadreza Djalali, who has been jailed in Iran and sentenced to execution on murky charges of treason, was left behind.

“Iran is perfecting the art of hostage diplomacy and playing everyone,” said Nizar Zakka, a Lebanese citizen who lives in the United States and was a prisoner in Iran from 2015 to 2019. He is the president of Hostage Aid Worldwide, an advocacy group that helps secure the release of hostages. “The West is making it easy for them because there is no unified policy against hostage taking.”

Iran’s hostage taking began almost as soon as the formation of the Islamic Republic in 1979, when a revolution toppled the monarchy of Shah Mohammed Reza Pahlavi.

A group of students seized the American Embassy in Tehran and took more than 50 Americans hostage, a 444-day standoff that permanently ruptured diplomatic relations between United States and Iran. The Iranians wanted the United States to send the deposed shah, who had advanced cancer, back to Iran. (The United States did not do that, and the hostages were finally released through negotiations mediated by Algeria.)

In the decades that came after, Iran would go on to arrest foreigners and dual nationals, including scholars, journalists, businessmen, aid workers and environmentalists. And with each arrest, it asked for and received more in return.

In 2016, the Obama administration made a $400 million cash payment to Iran. The payment, frozen Iranian assets, coincided with the release of four Americans including Jason Rezaian, a journalist for The Washington Post.

In 2020, Kylie Moore-Gilbert, a British Australian academic detained in Iran for two years, was released in a transnational swap that involved three Iranians detained in Thailand on bomb plot charges.

Nazanin Zaghari-Ratcliffe, an Iranian British aid worker, was freed after serving six years in jail only after Britain agreed to pay its $530 million debt to Iran. Those negotiations extended over multiple British governments.

And last year, in September, Iran released several American Iranian dual nationals, including the businessmen Siamak Namazi, Morad Tahbaz and Emad Sharghi, in exchange for several jailed Iranians. Iran also got access to $6 billion in frozen oil revenues with which it was allowed to make humanitarian purchases of things like food and medicine.

“Iran has been constantly pushing the envelope and learned how to swindle governments to get what it wants,” said Hadi Ghaemi, the director of the Center for Human Rights in Iran, an independent rights advocacy and documentation organization based in New York. “The danger is other authoritarian governments can learn from Iran and make hostage taking the norm.”

The news of Saturday’s exchange was a gut punch to victims of Iran’s human rights violations as well as rights advocacy groups more generally.

Many feared that Mr. Nouri’s trial, conviction and abrupt swap could affect the prospects of accountability and justice for war crimes in places like Russia, Syria and Sudan.

A news channel affiliated with the Islamic Revolutionary Guards Corps, the powerful elite unit in Iran’s armed forces, offered a brazen online assessment of Saturday’s deal. Referring to the two Swedish nationals exchanged for Mr. Nouri, it said, “These two were only arrested for the purpose of a swap.”

The post, on the messaging app Telegram, went on to comment approvingly that Iran had managed the deal without having to give up the third Swedish detainee, Mr. Djalali, in the negotiations.

Mr. Zakka, of Hostage Aid Worldwide, called it “just evil” for Sweden to leave Mr. Djalali behind, and said his group had written to the Swedish prime minister about two weeks ago urging the country to secure his release.

world