Belgium and Iran have carried out a prisoner swap involving Belgian aid worker Olivier Vandecasteele and Iranian diplomat Assadollah Assadi.
The Belgian prime minister announced that Mr Vandecasteele was currently flying home "after 455 days in prison in Tehran in unbearable conditions".
Mr Assadi, who Iran's foreign minister said was "illegally detained" for two years, has arrived in Tehran.
The two men were first transported to Oman, which brokered the exchange.
Mr Vandecasteele was sentenced to 40 years in prison and 74 lashes in January after an Iranian court convicted him of espionage and several other charges. He denied any wrongdoing, while Belgium said the charges were "fabricated" and amounted to retribution for Mr Assadi's sentence.
Mr Assadi was jailed for 20 years by a court in Belgium, which found him guilty of plotting a bomb attack on an exiled Iranian opposition group's rally in France. Iran insisted his arrest, trial and sentencing violated international law.
Belgium's Prime Minister Alexander de Croo announced that Mr Vandecasteele was flown on Thursday night from Iran to Oman, where he was cared for by Belgian military personnel and diplomats, and underwent a number of medical examinations.