Iran has released two French nationals who were detained there for more than three years, French President Emmanuel Macron has said.

Cécile Kohler, 41, and her partner Jacques Paris, 72, have been released from Evin prison, Macron announced on Tuesday, with France's foreign minister later confirming they were safe at the embassy in Tehran ahead of their final release.

I welcome this first step. The dialogue continues to allow for their return to France as quickly as possible, Macron stated.

The pair, who were arrested in May 2022 during a tourist trip, are believed to be the last French nationals held in Iran.

Last month, they were found guilty of spying on behalf of both France and Israel and were handed lengthy prison sentences, according to Iranian state media reports.

A number of Europeans have been held by Iran in recent years, with France accusing Iran of state hostage-taking and keeping its nationals in conditions akin to torture, allegations Tehran has denied.

In a statement to the AFP news agency on Tuesday, the pair's Paris-based legal team said the release of Kohler and Paris had ended their arbitrary detention which lasted 1,277 days. AFP also reported that their families have insisted they are wholly innocent.

Their freeing comes more than a month after Iranian Foreign Minister Abbas Araghchi said a deal to exchange French detainees for an Iranian woman held in France was nearly complete. Iran had indicated that Kohler and Paris could be released as part of that agreement.

Mahdieh Esfandiari, who has been held in France since February on charges of promoting terrorism on social media, was released conditionally by French authorities last month.