Mahmoud Mousavi Majd was convicted of spying on Iran's armed forces "especially the Quds Force and on the whereabouts and movements of martyr General Qassem Soleimani" for large sums of money from both Israel's Mossad and the US Central Intelligence Agency, judiciary spokesman Gholamhossein Esmaili told a televised news conference.
Majd's death sentence has been upheld by the supreme court and "will be carried out soon", he added.
Soleimani, who headed the Quds Force, the foreign operations arm of Iran's Revolutionary Guards, was killed in January in a US drone strike in Baghdad
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, arresting 17 suspects between March 2018 and March 2019 and sentencing some of them to death.
US President Donald Trump at the time dismissed the claim as "totally false".
Follow us on Twitter and Instagram to stay connected