The judiciary said Ali Reza Akbari, arrested in 2019, was a “key spy” for British intelligence, the semi-official Tasnim news agency reported. It said Iranian intelligence unmasked the spying by feeding him false information.
Tasnim also reported that he had spied on past nuclear talks between Iran and western powers. Mr Akbari had served as deputy defence minister until 2001 under President Mohammad Khatami, a reformist who had pushed for improved relations with the West.
British Foreign Minister James Cleverly called the sentence "a politically motivated act by a barbaric regime that has total disregard for human life".
For several years, Iran has been locked in a shadow war with the US and Israel, marked by covert attacks on its disputed nuclear programme. The killing of Iran’s top nuclear scientist in 2020, which Iran blamed on Israel, indicated foreign intelligence services had made major inroads.
Authorities have not released any details about Mr Akbari's trial. Those accused of espionage and other crimes related to national security are usually tried behind closed doors, where rights groups say they do not choose their own lawyers and are not allowed to see evidence against them.
Tasnim said the Supreme Court upheld his sentence and that he had access to a lawyer. There was no word on when the execution might be carried out.
Mr Akbari had previously led the implementation of a 1988 ceasefire between Iran and Iraq following their devastating eight-year war, working closely with UN observers.
- With reporting from agencies