The judiciary in June said Mahmoud Mousavi Majd, who was arrested in 2018, had spied on various security fields including the Quds Force which was headed by former Revolutionary Guards commander Qassem Soleimani.
Iran has executed a former translator convicted of spying for the US and Israel, including helping to locate a top Iranian general killed later by the Americans.
The killing of Major General Qasem Soleimani in a US drone strike near Baghdad airport in January brought decades-old arch-enemies Iran and the United States to the brink of conflict.
The judiciary's Mizan Online website said Mahmoud Mousavi Majd's death "sentence was carried out on Monday morning over the charge of espionage so that the case of his betrayal to his country will be closed forever".
Its spokesman said earlier this month that Majd had been sentenced to death for spying on "various security fields, especially the armed forces and the Quds Force and the whereabouts and movements of martyr General Qasem Soleimani".
Majd had been found guilty of receiving large sums of money from both the US Central Intelligence Agency and Israel's Mossad, said the spokesman Gholamhossein Esmaili.
Soleimani headed the Quds Force, the foreign operations arm of Iran's Islamic Revolutionary Guard Corps.
Iran retaliated against the United States for his death by firing a volley of ballistic missiles at US troops stationed in Iraq, but US President Donald Trump opted against responding militarily.
While the attack on the western Iraqi base of Ain Al Asad left no US soldiers dead, dozens suffered brain trauma.
Majd was arrested about two years ago and was not directly involved in the killing of Soleimani, according to a statement the judiciary issued in June.
Majd had migrated to Syria in the 1970s with his family and worked as an English and Arabic language translator at a company, Mizan said.
When war broke out, he chose to stay in the country while his family left.
"His knowledge of Arabic and familiarity with Syria's geography made him close to Iranian military advisers and he took responsibilities in groups stationed from Idlib to Latakia," the site added.
Majd was not a member of the Revolutionary Guards "but infiltrated many sensitive areas under the cover of being a translator".
He was found to have been paid "American dollars to reveal information on adviser convoys, military equipment and communication systems, commanders and their movements, important geographical areas, codes and passwords" until he came under scrutiny and his access was downgraded.
Iranian state television showed footage of what it said was one of Majd's CIA handlers, saying the alarm was raised after the interception of communications between the two.
It also showed Majd in an apparent confession video saying he had received coded messages and reportedly met his handlers with documents, including "photos and identification documents of forces and commanders".
Executions and arrests
According to the report, he had been planning to also work with Saudi Arabia's intelligence services before being detained.
He was arrested in October 2018, Mizan said.
Iran said last week it had executed another man convicted of spying for the CIA by selling information about Iran's missile programme.
Reza Asgari had worked at the defence ministry's aerospace division for years but retired four years ago, after which he sold "information he had regarding our missiles" to the CIA in exchange for large sums of money.
Iran in February handed down a similar sentence for Amir Rahimpour, another man convicted of spying for the US and conspiring to sell information on Iran's nuclear programme.
Tehran announced in December it had arrested eight people "linked to the CIA" and involved in nationwide street protests that erupted the previous month over a surprise petrol price hike.
It also said in July 2019 that it had dismantled a CIA spy ring, arrested 17 suspects between March 2018 and March 2019 and sentenced some of them to death.
Trump at the time dismissed the claim as "totally false".
Protests against executions
The execution comes at a time when millions of Iranians have taken to social media to protest against the death sentences awarded to three men accused of participating in anti-government protests last November.
Their executions have been suspended, one of their attorneys, Babak Paknia, said on Sunday.
Rights activists said the sentences for the three men were aimed at intimidating future protesters.
Witnesses said security forces fired tear gas last Thursday to disperse demonstrators in the southwestern city o f Behbahan who were protesting against economic problems but also the death sentences against the three men.
The Farsi hashtag “Don’t execute” was tweeted millions of times last week.