Iran's reformist candidate Masoud Pezeshkian, who advocates improved ties with the West, on Saturday won a runoff presidential election against ultraconservative Saeed Jalili, the interior ministry said.
Pezeshkian received more than 16 million votes, around 54 percent, and Jalili more than 13 million, roughly 44 percent, out of about 30 million votes cast, electoral authority spokesman Mohsen Eslami said.
Voter turnout was 49.8 percent, Eslami added, up from a record low of about 40 percent during the first round.
The election came against a backdrop of heightened regional tensions due to the Gaza war, a dispute with the West over Iran's nuclear programme, and domestic discontent over the state of Iran's sanctions-hit economy.
In his first comments after winning, Pezeshkian said the vote was the start of a "partnership" with the Iranian people.
"The difficult path ahead will not be smooth except with your companionship, empathy, and trust. I extend my hand to you," Pezeshkian said in a post on social media platform X.
On Tuesday he had said that, if he won, he would "extend the hand of friendship to everyone".
The defeated Jalili called on his supporters to now back Pezeshkian.
"The person who is elected by the people is respected, his respect should be maintained,... and now we should make all our efforts to help him move forward with strength," Jalili said in remarks made Tuesday and posted Saturday on X.
An election was not due until 2025 but was called early after the death of ultraconservative president Ebrahim Raisi in a helicopter crash.
Four candidates ran in the first round held on June 28.
Regardless of the election winner, Iran's supreme leader Ayatollah Ali Khamenei has the final say on all major policy issues.
Khamenei had called for a higher turnout in the runoff, and emphasised the election's importance.
He said the first round turnout was lower than expected, but added that it was not an act "against the system".
After more than one million ballots were spoiled in the first round, the figure in the runoff stood at more than 600,000, according to figures provided by Eslami.
The ballot came with some Iranians having lost faith in the system, according to analysts.
All candidates were approved by Iran's Guardian Council, which vets contenders. Pezeshkian was the lone reformist allowed to stand.
Political expert Ali Vaez, from the International Crisis Group think-tank, said that, despite his victory, Pezeshkian will face challenges in implementing his platform.
The "continued conservative dominance of other state institutions & limits of presidential authority mean Pezeshkian will face an uphill battle in securing the greater social and cultural rights at home and diplomatic engagement abroad emphasised during his campaign," Vaez said on X.
Pezeshkian is a 69-year-old heart surgeon whose only previous government experience came as health minister about two decades ago.
He has called for "constructive relations" with Western countries to revive the 2015 nuclear deal between Iran and global powers in order to "get Iran out of its isolation".
The United States unilaterally withdrew from the accord in 2018, reimposing sanctions and leading Iran to gradually reduce commitment to its terms. The deal aimed to curb nuclear activity which Tehran has maintained is for peaceful purposes.
Jalili, 58, an Iranian nuclear negotiator until 2013, is known for his uncompromising anti-West stance. He is currently one of Khamenei's representatives in the Supreme National Security Council, Iran's top security body.
Iran's foe the United States on Monday said it would make no difference whether Pezeshkian or Jalili won.
State Department spokesman Vedant Patel said there was no expectation the vote would "lead to a fundamental change in Iran's direction or lead the Iranian regime to offer more respect for human rights and more dignity for its citizens."
Russian President Vladimir Putin, however, on Saturday congratulated Pezeshkian and expressed hope for strengthened ties, the Kremlin said.
Iran's main reformist coalition supported Pezeshkian, with endorsements by former presidents Mohammad Khatami and Hassan Rouhani, a moderate who was in office until Raisi's victory in 2021.
Pezeshkian vowed to ease long-standing internet restrictions and to "fully" oppose police patrols enforcing the mandatory headscarf for women, a high-profile issue since the death in police custody in 2022 of Mahsa Amini.
The 22-year-old Iranian Kurd had been detained for an alleged breach of the dress code and her death sparked months of nationwide unrest.