The interior minister announces that the votes are still counting, but opponents of the future president have already congratulated Raisi via Instagram.

"I hope your administration gives the Islamic Republic of Iran pride, improves the economy and life with the comfort and well-being of the great nation of Iran."

In a televised speech, the incumbent president, Hassan Rouhani, also congratulated "the people's elected president", without naming the person.

He also said that he was waiting to say the name as the election result is not yet official, but that "it is clear who got the votes".

Allegedly ordered executions

As a judge in the 1980s, Ebrahim Raisi is accused of having been involved in ordering thousands of executions.

He has never commented on the allegations.

The choice comes at a crucial time, as negotiations are currently underway to revive Iran's nuclear deal.

The agreement entered into force under the outgoing president Hassan Rouhani, and would provide Iran with light economic sanctions against the country limiting its uranium enrichment.

But after the United States left the agreement three years ago, Iran's economy has fallen freely.