Results of the election are expected around noon Saturday. If no clear winner emerges, a runoff will be held on June 25, defying predictions.
Iranians have voted in a presidential election in which ultraconservative cleric Ebrahim Raisi is seen as all but certain to coast to victory after all serious rivals were barred from running.
After a lacklustre campaign, low turnout was expected on Friday in a country exhausted by a punishing policy of US economic sanctions that has dashed the hopes of many for a brighter future.
The supreme leader, Ayatollah Ali Khamenei, cast the first vote in Tehran and then urged Iran's nearly 60 million eligible voters to follow suit before the scheduled close of polls at midnight (1930 GMT).
"The sooner you perform this task and duty, the better," said the 81-year-old, stressing that voting "serves to build the future" of the Iranian people.
Just over 12 hours into voting, nationwide turnout had reached 37 percent, reported the Fars news agency, as overseas Iranians also cast their ballots in Iraq, Kuwait, Lebanon and elsewhere.
After a two-hour extension following calls from some media and the campaigns of candidates, voting officially closed at 2:00 am on Saturday (2130 GMT Friday).
Judiciary chief Raisi is seen as the race's favourite over a lack of real competition, but Iran's presidential elections have regularly led to surprises since 1997.
Results are expected around noon (0730 GMT) Saturday. If no clear winner emerges, a runoff will be held on June 25, defying predictions.
Pictures of often flag-waving voters in Iran dominated state TV coverage, but away from the stations some voiced anger at what they saw as a stage-managed election.
"Whether I vote or not, someone has already been elected," scoffed Tehran shopkeeper Saeed Zareie, referring to pre-election vetting that barred all but seven of the more than 600 hopefuls. "They organise the elections for the media."
Enthusiasm has been dampened further by the economic malaise of spiralling inflation and job losses, deepened by the Covid-19 pandemic.
"I'm not a politician, I don't know anything about politics," said Tehran car mechanic Nasrollah. "All families are now facing economic problems. How can we vote for these people who did this to us? It's not right."
Iranian opposition groups abroad and some dissidents at home have urged a boycott of the vote they see as an engineered victory for Raisi, the 60-year-old head of the judiciary, to cement ultraconservative control.
But many queued to vote at schools, mosques and community centres.
Many said they supported Raisi, who has promised an anti-corruption drive, help for the poor, and millions of flats for low-income families.
A nurse named Sahebiyan said she backed Raisi due to his anti-graft credentials and hopes he would "move the country forward ... and save the people from economic, cultural and social deprivation".
Ultimate political power in Iran, since its 1979 revolution toppled the US-backed monarchy, rests with the supreme leader.
But the president, as head of the executive branch of the government, also wields significant influence in fields from industrial policy to foreign affairs.
Election placards are relatively sparse in Tehran, dominated by those showing Raisi, in his trademark black turban and clerical robe. He has been named in Iranian media as a possible successor to Khamenei.
The election winner will take over in August from President Hassan Rouhani, a moderate who has served the maximum two consecutive four-year-terms allowed under the constitution.
Rouhani's landmark achievement was the 2015 deal with world powers under which Iran agreed to limit its nuclear programme in return for sanctions relief.
But high hopes for greater prosperity 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.
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 US, labelled the "Great Satan" or the "Global Arrogance" in Iran attacked Rouhani over the failing deal.
Despite this, there is broad agreement among all the election candidates that Iran must seek an end to the painful US sanctions in ongoing talks in Vienna.
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 those disqualified were former parliament speaker Ali Larijani and populist ex-president Mahmoud Ahmadinejad. Then, two days before polling day, three approved candidates dropped out of the race.
The only reformist still running is ex-central bank chief Abdolnaser Hemmati, who lacks broad support and is blamed by many for rampant inflation.
"For the first time since the foundation of the Islamic republic, the election of the president will take place without any real competition," wrote former French ambassador Michel Duclos for Paris think-tank the Institut Montaigne.
Tehran blacksmith Abolfazl, aged in his 60s, told AFP of his disappointment as a patriot who had joined the 1979 revolution.
"I took part in a revolution to choose for myself, not so others can choose for me," he said. "I love my country, but I do not accept these candidates."