The snap election was called after former president Ebrahim Raisi was killed in a helicopter crash in May.
Reformist candidate Masoud Pezeshkian has been elected as Iran’s new president, beating hardline conservative Saeed Jalili.
The country’s interior ministry confirmed Mr Pezeshkian’s victory on Saturday, after he secured 16.3 million of the votes to Mr Jalili’s 13.5 million.
The election was called after the death of former president Ebrahim Raisi who was killed in a helicopter crash in May.
Mr Pezeshkian managed to beat his rival Mr Jalili, after promising to reach out to the West and ease enforcement on the country’s mandatory headscarf law after years of sanctions and protests squeezing the Islamic Republic.
Videos on social media showed supporters of the 69-year-old heart surgeon dancing in streets in many cities and towns across the country and motorists honking car horns to cheer his victory.
The run-off (a second ballot) followed the first round of the election on 28 June which saw a historically low turnout, when over 60% of Iranian voters abstained.
Mr Pezeshkian was the only candidate out of six considered as a moderate.
He has vowed to revive the flagging economy – beset by mismanagement, state corruption and US sanctions – promote a pragmatic foreign policy and ease tensions over now-stalled negotiations with major powers to revive a 2015 nuclear pact.
According to analysts, will largely be welcomed by world leaders.
But Iran’s president can only influence the tone of Iran’s policies, with Supreme Leader Ayatollah Ali Khamenei the one who has the final say on all top state matters under Iran’s dual system of clerical and republican rule.
He might also meet resistance from the Iranian government which is still largely held by hard-liners.
The election also came amid heightened regional tensions.
In April, Iran launched its first-ever direct attack on Israel over the war in Gaza, while militia groups that Tehran arms in the region – such as the Lebanese Hezbollah and Yemen’s Houthi rebels – are engaged in the fighting and have escalated their attacks.
Having been a politician since 2008, Mr Pezeshkian has supported the rights of ethnic minorities and has criticised the clerical establishment’s suppression of political and social dissent.
In 2022, he demanded clarification from authorities about the death of Mahsa Amini, a woman who died in custody
after she was arrested for allegedly violating a law restricting women’s dress. Her death sparked months of unrest across the country.
Meanwhile Mr Jalili is a staunch advocate of deepening ties with Russia and China and has hard-line views over Iran’s mandatory headscarf, or hijab law.