Reformist Massoud Pezeshkian has been elected Iran's new president, beating his hardline conservative rival Saeed Jalili.
The vote was declared in Dr Pezeshkian's favour after he secured 53.3% of the more than 30 million votes counted. Mr Jalili polled 44.3%.
The run-off came after no candidate secured a majority in the first round on 28 June, which saw a historically low voter turnout of 40%.
The election was called after Iran’s previous president Ebrahim Raisi was killed in a helicopter crash in May, in which seven others died.
Even before the final results were declared by Iran's interior ministry, Dr Pezeshkian's supporters had taken to the streets in Tehran and a number of other cities to celebrate.
Videos posted on social media showed mostly young people dance and wave the signature green flag of his campaign, while passing cars sounded their horns.
Dr Pezeshkian, a former heart surgeon, is critical of Iran’s notorious morality police and caused a stir after promising “unity and cohesion”, as well as an end to Iran's “isolation” from the world.
He has also called for “constructive negotiations” with Western powers over a renewal of the faltering 2015 nuclear deal in which Iran agreed to curb its nuclear programme in return for an easing of Western sanctions.
His rival, Saeed Jalili, favours the status quo. The former nuclear negotiator enjoys strong support amongst Iran’s most religious communities.
Mr Jalili is known for his hardline anti-Western stance and opposition to restoring the nuclear deal, which he says crossed Iran’s “red lines".
Turnout in the latest round of voting was 50% - higher than the first round last week, when the turnout was the lowest since the Islamic revolution in 1979 amid widespread discontent, but still low.
Widespread discontent meant that millions of people boycotted the elections.
Lack of choice in the candidates, dominated by Islamic hard liners, and the impossibility of real change as long as the supreme leader tightly controls policies added to their frustration.
Some people who did not vote in the first round were persuaded to cast their ballot for Dr Pezeshkian this time round to prevent Mr Jalili from becoming the president.
They feared that with the victory of Mr Jalili, Iran would be heading for more confrontation with the outside world and that he would bring Iran nothing but more sanctions and more isolation.
source: commonspace.eu with BBC (London) and al Jazeera (Doha) and agencies.
photo: The new president of Iran Massoud Pezeshkian
u with BBC