STOCKHOLM (Reuters) -Sweden and Iran carried out a prisoner exchange on Saturday, officials said, with Sweden freeing a former Iranian official convicted for his role in a mass execution in the 1980s while Iran released two Swedes being held there.

The prisoner swap was mediated by Oman, the country's foreign ministry said in a statement.

Sweden had freed convicted former Iranian official Hamid Noury, Iran's top human rights official said on X. Noury, who had been convicted for his part in a mass execution of political prisoners in Iran in 1988, would be back in Iran in a few hours, the official added.

Separately, Swedish Prime Minister Ulf Kristersson said in a statement that Swedish citizens Johan Floderus and Saeed Azizi who had been detained in Iran were on a plane back to Sweden.

"Iran used them both as pawns in a cynical negotiations game with the purpose of getting the Iranian citizen Hamid Noury released from prison in Sweden. He is convicted of serious crimes committed in Iran in the 1980s," Kristersson said.

"As prime minister I have a special responsibility for Swedish citizens' safety. The government has therefore worked intensively on the issue, together with the Swedish security services which have negotiated with Iran."

Kristersson confirmed in a video released by the government that Noury was now being transported back to Iran. Kristersson declined to give further details around the considerations, citing security concerns.

Noury, 63, was arrested at a Stockholm airport in 2019 and later sentenced to life in prison for war crimes for the mass execution and torture of political prisoners at the Gohardasht prison in Karaj, Iran, in 1988. He denied the charges.

Floderus was arrested in Iran in 2022 and charged with spying for Israel and "corruption on earth", a crime that carries the death penalty.

(Reporting by Niklas Pollard, Johan Ahlander and Dubai newsroom, additional reporting by Adam Makary in Cairo; Editing by Kirsten Donovan and Ros Russell)