Iran has executed a nuclear scientist convicted of handing over "top secret" information to the United States, a judicial spokesman has said.

"Shahram Amiri was hanged for revealing the country's top secrets to the enemy [US]," the spokesman, Gholamhossein Mohseni Ejeie, was quoted as saying by the Mizan Online news agency on Sunday.

A day earlier, Amiri's mother told the BBC that "the body had been handed over with rope marks around his neck".

Amiri disappeared in Saudi Arabia in June 2009 and resurfaced a year later in the United States. In a surprise move, Amiri then returned to Tehran in July 2010, saying he had been kidnapped at gunpoint by two Farsi-speaking CIA agents in the Saudi city of Medina.

At first he was greeted as a hero in Tehran, telling reporters as he stepped off the plane that he had resisted pressure from his US captors to pretend he was a defector. He said US officials wanted him to tell the media he had "defected on his own and was carrying important documents and a laptop which contained classified secrets of Iran's military nuclear programme".

"But with God's will, I resisted," Amiri said as he was welcomed home by his tearful wife and young son.

However, it was soon clear that Iranian authorities had not accepted his version of events and Amiri dropped out of public view. He was probably arrested although it was never officially reported.

Tehran 'outsmarted' the US

Ejeie said the Iranian intelligence services had "outsmarted" the US.

"This person, having access to confidential and highly confidential information of the regime, had established a connection to our number one enemy, America, and had provided the enemy with Iran's confidential and vital information," he said.

"Shahram Amiri was tried in accordance with law and in the presence of his lawyer. He appealed his death sentence based on judicial process. The Supreme Court ... confirmed it after meticulous reviews," he added.

Numerous media reports in recent years have supported the idea that Amiri was a defector with highly prized information on Tehran's nuclear programme.

"Shahram Amiri described to American intelligence officers details of how a university in Tehran became the covert headquarters for the country's nuclear efforts," the New York Times reported in July 2010, citing unnamed US officials.

"While still in Iran, he was also one of the sources for a much-disputed National Intelligence Estimate on Iran's suspected weapons programme, published in 2007," the report said.

Between 2010 and 2012, four nuclear scientists were assassinated inside Iran and a fifth survived a bomb attack. The government blamed the attacks on US and Israeli intelligence services.

Iran finally reached a deal with world powers, who had grown increasingly concerned that Iran was pursuing a nuclear weapon, in July 2015, when Tehran promised to curb its programme in exchange for a lifting of international sanctions.

Tehran and Washington have had no diplomatic ties since 1980, when students stormed the American embassy following the 1979 Islamic revolution.