Iran's billionaire tycoon Babak Zanjani has been sentenced to death for corruption after a long trial in which he was accused of fraudulently pocketing $3.76 billion.

Zanjani became notorious during the era of president Mahmoud Ahmadinejad, finding ways to channel hard currency from oil sales to Tehran despite financial sanctions imposed on the Islamic republic's banks as punishment for its nuclear program.

The 41-year-old was convicted of fraud and economic crimes and as well as facing the death penalty he must repay money to the state, judiciary spokesman Gholam Hossein Mohseni-Ejeie said.

The trial was held in public, a rarity for such a major case in Iran, and two other accused were also convicted of "corruption on Earth", the most serious offence under the country's criminal code, meaning they too will face the death penalty.

"The preliminary court has sentenced these three defendants to be executed, as well as paying restitution to the plaintiff," Mr Mohseni-Ejeie said, adding that that was the oil ministry.

They must also pay a "fine equal to one-fourth of the money that was laundered", the spokesman said, without specifying the sum.

Zanjani, who can appeal, had denied any wrongdoing, insisting that the only reason the money had not been paid to the oil ministry was that sanctions had prevented a planned transfer from taking place.

However, the case follows repeated declarations from the current government of President Hassan Rouhani that corruption and the payment of illegal commissions thrived under President Ahmadinejad.

Other trials are ongoing.

Zanjani had repeatedly said in media interviews that in return for commissions paid by the Ahmadinejad government he was tasked with circumventing sanctions to get money back to Iran.

In October last year, however, President Rouhani's oil minister Bijan Zanganeh signalled the shifting political balance in Iran, hitting out at the use of middlemen such as Zanjani, who before being arrested had boasted of his personal wealth.

Iranian media have put it as high as $18.15 billion.

Speaking after Iran concluded a nuclear deal with world powers, paving the way for increased foreign activity in Iran's oil sector, Mr Zanganeh urged investors to deal directly with his ministry and avoid third parties.

"We despise the corrupt parasites that want to suck the nation's blood even in this situation," Mr Zanganeh said, to loud applause at an oil and energy industry event in the capital while Zanjani's trial was under way.