Vote counting began in Iran on Saturday after a large turnout in a presidential election that could determine the country's pace of social and economic reform and its re-engagement with the world.
Friday's poll was expected to be a two-horse race between reformist President Hassan Rouhani and conservative challenger Ebrahim Raisi. Two other candidates were also on the ballot - conservative Mostafa Mirsalim and reformist Mostafa Hashemitaba - though they are not expected to win more than a few percent of the vote.
Voting was extended by at least five hours to 11pm (18:30 GMT) because many people were still waiting in line. Interior Minister Abdolreza Rahmani-Fazli said that by law voting could not continue past midnight.
Final results are expected within 24 hours of polls closing. The elections are also for city and village councils.
Iran's state television showed long queues outside voting stations in several cities, shortly after polls opened at 03:30 GMT. Some 56 million people were eligible to vote.
Supreme Leader Ayatollah Ali Khamenei cast his ballot in the capital, Tehran. "The country's fate is determined by the people," he said, urging voters to take to the polls.
|The election is seen as a verdict on Rouhani's policies towards the economy and the world [Tima/Reuters]|
The election is seen by many as a verdict on Rouhani's policy of opening up Iran to the world and his efforts to rebuild its stagnant economy.
Having been elected in a landslide four years ago on a promise to reduce the country's international isolation, Rouhani negotiated a historic deal with world powers in 2015 to curb Iran's nuclear programme in exchange for sanctions relief.
But the president faces strong competition from Raisi who has made grounds by positioning himself as a defender of the poor and calling for a much tougher line with the West.
"The election boils down to whether Rouhani is allowed a second term to finish what he began, or potentially Iran taking a different turn and standing up to the outside world," Al Jazeera's Jonah Hull, reporting from Tehran, said.
He added that a high voter turnout "would tend to favour the moderate reformist side of President Rouhani and anything less than 60 percent would spell trouble for him".
|Raisi has tried to gain support by promising more financial support to the working class and poor [Reuters]|
Rouhani has sought to frame the election as a choice between greater civil liberties and "extremism".
He pushed boundaries during the campaign, criticising the continued arrest of reformist leaders and activists, and calling on security agencies to not interfere in the vote.
Raisi has said he will stick by the nuclear deal but pointed to the continued economic slump as proof that Rouhani's diplomatic efforts have failed.
"Instead of using the capable hands of our youth to resolve problems, they are putting our economy in the hands of foreigners," Raisi said at a final rally in the city of Mashhad on Wednesday.
Rouhani responded by calling on voters to keep hardliners away from Iran's delicate diplomatic levers.
"One wrong decision by the president can mean war and a correct decision can mean peace," he said at his own Mashhad rally.
The election comes at a tense moment in Iran's relations with the United States. US President Donald Trump has previously said that he would "rip up" the nuclear deal.
On Wednesday, Rouhani gained what is seen as a reprieve when the Trump administration agreed to continue waiving nuclear-related sanctions, keeping the agreement on track for now.
Yet Trump, who is visiting Iran's regional rival Saudi Arabia this weekend, launched a 90-day review of the accord that could still see it abandoned.
Rouhani has vowed to work towards removing the remaining non-nuclear sanctions, but critics argue that will be hard with Trump in power.
While the nuclear deal has been at the forefront of the election, the issues of poverty and unemployment have dominated the campaign.
Rouhani has brought inflation down from around 40 percent when he took over in 2013, but prices are still rising by over seven percent a year.
Oil sales have rebounded since the nuclear deal took effect in January 2016, but growth in the rest of the economy has been limited, leaving unemployment at 12.5 percent overall - close to 30 percent for the young - and many more are under-employed or struggling to get by.
Rouhani's opponents have criticised him over his economic record, saying his diplomatic efforts have done little to tackle unemployment and poverty.
Raisi has tried to gain support by promising more financial support to the working class and to triple cash handouts to the poor.
"[Raisi] is thinking about the people, simple people; he's thinking about poor people," one of his supporters told Al Jazeera.
But for others, Rouhani is the best candidate to tackle the country's key issues.
"We demand, as we have before, that the problem of youth unemployment be solved … I think Rouhani is the best choice and with anyone other than him I think our conditions would deteriorate," a young voter told Al Jazeera.
Nasser Hadian, a professor at the University of Tehran, said the election was about more than just the economy.
"For a number of people, for an important section of society ... it is about respect, it is about human rights, it is about security and stability."
Source: Al Jazeera and news agencies