Last week Iran executed a nuclear scientist on charges of spying for the United States,an official said Sunday.Officials admitted for the first time that Shahram Amiri had been secretly detained and tried.A judicial spokesman said a court sentenced Amiri to death.Iran's Supreme Court upheld the sentence.The spokesman said, "Amiri gave vital information about the country to the enemy,"according to Iran's official news agency IRNA.The spokesman did not say why officials had not announced the sentence earlier,according to AP news agency.Iran hanged Amiri during the same week it executed a number of militants.Shahram Amiri, 38, was a university researcherwho worked for Iran's Atomic Energy Organization.He is said to have left Iran for Saudi Arabia in 2009 to visit Muslim holy places.However, he disappeared and went to the United States.While in the U.S., Amiri appeared in several videos.The AP news agency reported that the videos gave contradictory informationabout why he was in America.In one video, Amiri said that he had been kidnappedand that Saudi and U.S. intelligence agents held him against his will.In another, he said he wanted to study in America and return to Iranif the "opportunity of safe travel" became available.His wife and son remained in Iran.U.S. officials said they paid Amiri $5 million to leave Iranand provide information about its nuclear program.At the time, Western countries were increasing effortsto limit Iran's nuclear program under then-president Mahmoud Ahmadinejad.In 2010, Amiri reportedly went to the Pakistani Embassy in Washingtonand asked to be returned to Iran. He returned later that year.At first, Iranian officials welcomed him.AP reports that he appeared on Iranian TV as a hero.But then he disappeared.The judiciary spokesman said Amiri's family mistakenly believedthat he was serving a 10-year prison sentence.Last week, news of his death reportedly appeared in a newspaper in his hometown.For years, Iran has stated that its nuclear activitieswere not aimed at developing nuclear weapons.However, the U.S. says uranium particles found during an investigation last yearat an Iranian military base probably came from Iran's secret nuclear weapons program.The execution of Amiri takes place one year after the United Statesand five world powers reached a nuclear agreement with Iran.The deal requires Iran to limit its nuclear development capabilities.In exchange, western countries lifted strong economic restrictions on Iran.