It was a win-win for Russia's foreign and federal security services.
Moscow handed over 16 prisoners to the West, comprised of journalists, pro-democracy campaigners, a former US marine who had gone to Russia in 2018 for a friend's wedding and a German national convicted of drug trafficking because he was carrying cannabis-flavoured gummy bears.
In exchange, Moscow got back eight highly trained operatives and convicted fraudsters.
One of the Russians released is Vadim Krasikov, a convicted murderer and FSB agent, who Russian President Vladimir Putin hugged as he stepped off a plane in Moscow on Thursday night.
Two other Russian agents, a married couple with two children, lived in Slovenia and posed as an Argentinian family who ran an art business and IT firm.
They had only spoken Spanish at home to their two children.
Another operative posed as a Brazilian national and taught at a university in Norway before being convicted of collecting intelligence.
It is the stuff of spy novels.

"We have to understand that the level of activity of Russian spies in the West is very high," Igor Gretskiy, a Russian foreign policy analyst, told RTÉ News.
"Foreign intelligence activities are a priority in Russian foreign policy and always have been since Soviet times," said Mr Gretskiy, a fellow at Estonia's International Centre for Defence and Security.
Since Russia's full-scale invasion of Ukraine and its ongoing war, diplomatic relations between Russia and the West - bar Hungary and, to a certain extent, Turkey - have been cut.
Yet, for months, Western and Russian diplomats discussed the prisoner exchange that eventually took place on Thursday.
"I think the moment was chosen, ultimately, by Russia," said Witold Rodkiewicz, a senior expert on Russian foreign policy.
"The Russian side is very carefully observing the internal politics of their main adversary and this timing is not accidental," Mr Rodkiewicz said from Warsaw's Centre for Eastern Studies.
Russian officials, he believes, understood that the prisoner exchange would serve the current Democrat administration’s campaign in the lead up to November’s US presidential election.
US President Joe Biden and Vice President Kamala Harris, now the Democratic Party's leading candidate for November's presidential election, emerge from this process looking accomplished.
Both Mr Biden and Ms Harris were on the tarmac in Washington to greet Evan Gershkovich and Paul Whelan, two of the freed US citizens.

The current administration's delivery of the prisoner exchange also puts a dent in Donald Trump's rhetoric that only he can negotiate successfully with Russia.
There is a wide-held assumption that Mr Putin would be pleased to see a second Donald Trump administration in the White House, given Mr Trump’s and, his running mate, JD Vance’s lukewarm views on supporting Ukraine.
However, the previous Trump administration did not yield any special relationship between the US and Russia.
Kremlin spokesperson Dmitry Peskov told reporters in June, that Mr Trump's term as president from 2017 to 2021 had resulted in "nothing good" for Russia, although he added there had been some dialogue between Moscow and Washington as opposed to none.
That was before Russia launched its full-scale invasion of Ukraine so it is understandable that the Biden administration cut dialogue.
One of the main reasons behind the prisoner exchange, said Mr Rodkiewicz, was to encourage the current US administration "to come up with some offers for negotiations" on Ukraine and wider confrontations between the east and west.
Russia, he said, understands that the side that comes up with the initiative to start talks "demonstrates it is more eager to reach an agreement".
At the moment, it is Ukraine that is proposing another peace summit and it is open to Russia taking part, provided it agrees to Kyiv's peace formula.

However, there is little hope of Moscow agreeing to talks based on Ukraine's plan, which hinges on a core principle of regaining territory occupied by Russia.
Yesterday, Kremlin spokesperson Dmitry Peskov said that the prisoner exchange deal was based on "completely different principles" unrelated to any possible talks on the conflict in Ukraine.
Turkey's role in facilitating the prisoner exchange at an airport in Ankara was worth noting.
Though a NATO member, Turkey has played a balancing act between Russia and Ukraine during the course of the war so far.
Soner Cagaptay, the director of the Washington Institute's Turkish Research Program told RTÉ News that Turkey's position on the war has been "pro-Ukrainian but not anti-Russian".
Turkey supports Ukraine militarily by supplying it with drones and does not accept Russia's occupation of Ukrainian territory, including Crimea, a position it has held since Moscow's illegal annexation of the peninsula in 2014.
Turkey, Mr Cagaptay said, does not want to see Ukraine fall under Russian control because Russia is Turkey's "historical nemesis".
A Ukrainian defeat would mean that Russia would become the dominant power in the Black Sea, which Turkey wants to avoid.

At the same time, Turkey continues its close economic ties with Russia. Ankara has not backed the West's sanctions against Russia and is a big purchaser of Russian crude oil imports.
This on-going balancing act, and Turkey's role in facilitating the prisoner exchange, places it high on the list as a potential mediator of talks between Ukraine and Russia.
"I think that if there are Ukraine ceasefire talks, these talks will definitely be held in Turkey. It is the only large power that both countries rely on," said Mr Cagaptay.
The 16 westerners and Russian citizens released to the west, along with their families, are glad that their ordeal is over.
But there could be a long-term downside to this kind of prisoner swap.
It sends a signal to Russian sleeper agents operating in western countries that, even if they are caught, Russia's diplomatic corps will do everything it can to get them back home. Even those convicted of murder.