Iranian President Hassan Rouhani won a resounding re-election victory today as voters overwhelmingly backed his efforts to reach out to the world and rebuild the struggling economy.
Rouhani, a 68-year-old moderate cleric who spearheaded a 2015 nuclear deal with world powers, took 23.5 million votes -- 57 per cent -- compared to 15.8 million -- 38.3 per cent -- for hardline challenger Ebrahim Raisi.
But Iran's efforts to open up to the world face a stark challenge from US President Donald Trump, who has threatened to tear up the nuclear deal and is currently visiting its bitter regional rival Saudi Arabia.
Iranians nonetheless flocked to the polls, with turnout hitting 73 per cent.
Election organisers were forced to extend polling by several hours yesterday, as they struggled to adapt to a population explosion that has added 20 million names to the voting rolls in the past two decades.
"Already last night we had the feeling we were heading for a landslide, and it came true," said Farid Dehdilani, an adviser for the Iranian Privatisation Organisation, who worked on Rouhani's campaign.
"Our people reaffirmed their confidence in President Rouhani and their support for engagement with the world," he added.
Raisi, 56, had positioned himself as a defender of the poor and called for a much tougher line with the West.
But his revolutionary rhetoric and efforts to win over working class voters with promises of increased handouts gained limited traction.
"Rouhani's vote, particularly in rural areas, shows that Iranian people no longer believe in economic populism and radical change," said Ali Vaez, Iran analyst for the International Crisis Group, a think tank.
"They have the maturity to understand that the solution to their country's predicaments are in competent management of the economy and moderation in international relations," Vaez told AFP.
Russian President Vladimir Putin, a staunch ally of Iran in the Syrian conflict on the side of the Damascus regime, was among the first leaders to congratulate Rouhani.
The Kremlin said Putin sent a telegram confirming "his readiness to continue active joint work... In line with maintaining stability and security in the Middle East and the world as a whole."
EU foreign policy chief Federica Mogherini also tweeted her congratulations and vowed to work for greater "engagement, regional peace... (and the) expectations of people in Iran."
Both Russia and the European Union are eager to safeguard the 2015 deal which they signed alongside the United States, easing sanctions on Iran in exchange for curbs to its nuclear programme.
Although Rouhani has been deeply entrenched in Iran's security establishment since the early days of the revolution, he has emerged as the standard-bearer for reformists after their movement was decimated in the wake of mass protests in 2009.
He took aim at the conservative-dominated judiciary and security services, telling supporters: "We've entered this election to tell those practising violence and extremism that your era is over."
International affairs researcher Foad Izadi, of Tehran University, said Rouhani may now have the leverage to push for more freedoms, including the release of opposition leaders under house arrest for their part in the 2009 protests.
"A number of years have passed (since the protests) and the country is demonstrating a high level of stability -- this gives the system confidence, which means more room for change," Izadi said.
But the economy remains the number one challenge.
"Dr Rouhani will more aggressively pursue his economic agenda -- investing in factories, production and absorbing foreign capital," said Dehdilani.
"I think he'll make the cabinet younger and more agile."
Although Rouhani brought inflation down from around 40 percent when he took office in 2013, prices are still rising at 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 among young people.
Nonetheless, Rouhani's expansion of healthcare and support for agricultural producers were seen as boosting his support even in more conservative rural areas.
"Not everyone who voted for Rouhani thought his record was excellent, but the majority decided his competitor would be even worse," said Izadi.