Polling was extended in Iran on Friday as voters flocked to deliver their verdict on President Hassan Rouhani and his troubled efforts to rebuild ties with the world and kickstart the struggling economy.
Rouhani, a 68-year-old moderate cleric who spearheaded a 2015 nuclear deal with world powers, has framed the vote as a choice between greater civil liberties and "extremism."
But he faces stiff competition from hardline cleric Ebrahim Raisi, 56, who has positioned himself as a defender of the poor and called for a much tougher line with the West.
With long queues still seen at polling stations, authorities extended the vote into the late evening, with reformist backers of the president urging voters to keep waiting or find quieter stations.
"The enthusiastic participation of Iranians in the election reinforces our national power and security," said Rouhani as he cast his vote in Tehran.
By 8:00 p.m., local agencies reported 30 million — more than half of registered voters — had cast their ballot.
But Raisi's campaign was already complaining about the conduct of the election even before polls closed, saying there had been hundreds of "propaganda actions" by Rouhani supporters at voting booths, which are banned under election laws.
Raisi has targeted working-class voters hit by high unemployment and austerity measures, as well as those who worry that the values of the 1979 revolution are under threat.
"His main focus is deprived people and he wants to fight corruption," said Mohsen, a 32-year-old Raisi supporter.
"Our country is surrounded by enemies — if we don't strengthen our domestic situation, we will be harmed."
Rouhani's central achievement was a deal with six powers led by the United States that eased crippling economic sanctions in exchange for curbs to Iran's nuclear program — efforts which he said must be protected from hardliners.
"One wrong decision by the president can mean war," he warned this week.
His opponent says he will stick by the nuclear deal, but points to a persistent economic slump as evidence Rouhani's diplomatic efforts have failed.
"Instead of using the capable hands of our young people to resolve problems, they are putting our economy in the hands of foreigners," Raisi said at a closing campaign rally in second city Mashhad.
Rouhani gained a reprieve on Wednesday when Washington agreed to continue waiving nuclear-related sanctions, keeping the deal on track for now.
But US President Donald Trump has launched a 90-day review of the accord that could see it abandoned, and is visiting Iran's bitter regional rival Saudi Arabia this weekend.
Supreme leader Ayatollah Ali Khamenei voted at his compound just minutes after polls opened, saying: "The destiny of the country is in the hands of Iranians."
Reformists and many celebrities in the nation of 80 million have backed Rouhani.
Oscar-winning director Asghar Farhadi, a vocal Rouhani supporter, voted in Cannes, France where he was attending the film festival.
"I want social justice, social freedoms and political development, and good relations with all countries in the world," said Rouhani supporter Nasim, a 37-year-old university lecturer.
Despite the global implications, it is the economy that has dominated the campaign.
Rouhani has brought inflation down from around 40 percent when he took office in 2013, but prices are still rising by nine percent a year.
Oil sales have rebounded since the nuclear deal took effect in January last year, but growth in the rest of the economy has been limited, leaving unemployment at 12.5 percent overall, and at almost 30 percent for young people.
Still, many appear willing to give his policies time to bear fruit, and hope Rouhani can lift the remaining US sanctions that are stifling trade.
"I've almost lost my entire business in recent years. Our small importers can't afford to bypass sanctions and it's illegal," said first-time voter Amir Fathollahzadeh, 51.
"I'm voting for Rouhani to try to save my dignity."
Meanwhile, Raisi has promised to triple cash handouts to the poor, hoping to pick up voters who once supported Rouhani's populist predecessor Mahmoud Ahmadinejad.
"Unfortunately in recent years the dialogue of revolution has been weakened. People should restore the revolution's path," said Raisi supporter Mahanz Rafii, 50, a theology professor wearing her head-to-toe chador robes.
Having proved too independent for the conservative establishment, Ahmadinejad was dramatically barred from standing by the Guardian Council last month as it disqualified all but six of the 1,636 hopefuls who registered.
The presidential race has since narrowed to a two-horse race as other candidates either pulled out or backed Rouhani or Raisi.
Iranians are also voting for local councils, with reformists hoping to overturn the conservatives' narrow majority in the capital.
The World is an independent newsroom. We’re not funded by billionaires; instead, we rely on readers and listeners like you. As a listener, you’re a crucial part of our team and our global community. Your support is vital to running our nonprofit newsroom, and we can’t do this work without you. Will you support The World with a gift today? Donations made between now and Dec. 31 will be matched 1:1. Thanks for investing in our work!