Polling stations in Iran's presidential election have now closed after around 19 hours of voting, the official IRNA state news agency reported.

"The election officially ended at 2.00am," election committee spokesman Esmail Mousavi was quoted as saying, after a two-hour extension.

Millions of Iranians voted in a contest set to hand the presidency to a hardline judge who is subject to US sanctions.

Ultraconservative cleric Ebrahim Raisi is seen as all but certain to coast to victory after all serious rivals were barred from running.

Senior officials appealed for a large turnout in an election widely seen as a referendum on their handling of the economy, including rising prices and unemployment and a collapse in the value of its currency.

"I urge everyone with any political view to vote," judiciary head Ebrahim Raisi, the front-runner in the contest, said after casting his ballot.

"Our people's grievances over shortcomings are real, but if it is the reason for not participating, then it is wrong."

While state television showed long queues at polling stations in several cities, the semi-official Fars news agency reported 22 million or 37% of voters had cast ballots by 7:30pm.

Supreme leader Ayatollah Ali Khamenei cast the first vote just after 7am (3.30am Irish time) at a specially installed ballot box at a mosque adjoining his offices in the capital.

Results are expected around midday tomorrow.

The winner will take over in August as Iran's eighth president from incumbent Hassan Rouhani, a moderate who has served the maximum of two consecutive four-year-terms allowed under the constitution.

Ultimate political power in Iran, since its 1979 revolution toppled the US-backed monarchy, rests with the supreme leader.

But the president of the Islamic republic, as the top official of the state bureaucracy, also wields significant influence in fields from industrial policy to foreign affairs.

But high hopes for greater prosperity and a reopening to the world were crushed in 2018 when then-US president Donald Trump withdrew from the accord and launched an economic and diplomatic "maximum pressure" campaign against Iran.

While Iran has insisted its nuclear programme is for peaceful purposes only, Mr Trump accused it of secretly seeking the bomb and of destabilising the wider Middle East through armed proxy groups.

As old and new US sanctions hit Iran, trade dried up and foreign companies bolted.

The economy nosedived and spiralling prices fuelled repeated bouts of social unrest which were put down by security forces.

Iran's ultraconservative camp, which deeply distrusts the United States, labelled the "Great Satan" or the "Global Arrogance" in the Islamic republic, attacked Mr Rouhani over the failing deal.

They swept parliament early last year and now look set to claim the presidency in the nationwide poll that will also elect municipal and other officials.

Out of an initial field of almost 600 hopefuls for the presidency, only seven -- all men -- were approved to run by the Guardian Council, a body of 12 clerics and jurists.

Among the prominent figures disqualified were conservative former parliament speaker Ali Larijani. Then, two days before the election, three of the seven approved candidates dropped out of the race.

The only reformist still running is a technocrat, central bank chief Abdolnasser Hemmati, who has promised to revive the economy and, unusually in Iran, involved his wife in campaigning.

Iran has often pointed to voter participation as proof of democratic legitimacy, but polls signal the turnout may drop below the 43% of last year's parliamentary election.

If no clear winner emerges, a run-off will be held a week later.