WASHINGTON — An Iranian nuclear scientist has been hanged for treason for providing secrets to the US, Tehran has confirmed, less than a year after emails from Hillary Clinton’s private server were released apparently referencing Shahram Amiri as “our friend.”

Amiri had once claimed to be abducted by the CIA, but emails on the Clinton email server released last summer seemed to have confirmed what US officials had been saying at the time: Amiri helped the United States learn about Iran’s nuclear weapons capabilities but then had second thoughts.

Amiri went missing in 2009 after going on religious pilgrimage to Mecca, Saudi Arabia. He emerged in the United States in 2010 and eventually had gone to Iran’s special interest section at the Pakistan embassy seeking help to get back Iran.

In one email exchange dated in July 2010, Clinton’s lead foreign affairs advisor, Jake Sullivan, flagged Clinton to unwanted media attention regarding Amiri’s desire to go back.

“The gentleman you have talked to Bill Burns about has apparently gone to his country’s interests section because he is unhappy with how much time it has taken to facilitate his departure,” Sullivan wrote. “This could lead to problematic news stories in the next 24 hours. Will keep you posted.”

A day after the email exchange, Clinton made a public statement July 13, 2010, that Amiri was under no pressure. “He’s free to go. He was free to come. Those decisions are his alone to make.”

The emails were part of some 30,000 released by the State Department.

Another email to Clinton a week earlier on July 5, 2010, also appeared to reference Amiri, just after someone purporting to be the scientist posted online videos claiming to have been kidnapped and pressured to spill secrets to the US.

“Per the subject we discussed, we have a diplomatic, ‘psychological’ issue, not a legal issue,” Richard Morningstar, then acting special envoy of the U.S. secretary for Eurasian energy, emailed Clinton.

“Our friend has to be given a way out. We should recognize his concerns and frame it in terms of a misunderstanding with no malevolent intent and that we will make sure there is no recurrence. Our person won’t be able to do anything anyway. If he has to leave, so be it.”

US officials at the time told the AP Amiri was paid $5 million to offer the CIA information about Iran’s nuclear program, though he left the country without the money. Analysts suggested Amiri changed his mind about defecting because the Iranian government could have threatened his family back home.

Sen. Tom Cotton blasted Clinton for discussing Amiri on her private email server.

“There were conversations among her senior advisers about this gentleman,” the Arkansas Republican told CBS’s “Face the Nation.” “That goes to show just how reckless and careless her decision was to put that kind of highly classified information on a private server. I think her judgment is not suited to keep this country safe.”

When Amiri returned to Iran in July 2010, he was first hailed as a hero in Tehran. But he was eventually arrested and tried for treason. His family confirmed his execution when his body was returned with rope marks around his neck.

Iranian judiciary spokesman Gholamhosein Mohseni Ejehi said Amiri “had access to the country’s secret and classified information” and “had been linked to our hostile and No. 1 enemy, America, the Great Satan.”

With Post Wires