Reformist-backed cleric Hassan Rouhani has won Iran's presidential election, securing just over 50% of the vote and so avoiding the need for a run-off.
Crowds gathered in Tehran to hail Mr Rouhani, who said he had achieved a "victory of moderation over extremism".
A turnout of 72.2% was registered of the 50 million Iranians who were eligible to vote for the successor to Mahmoud Ahmadinejad.
Tehran Mayor Mohammad Baqer Qalibaf was well behind in second place.
Supreme Leader Ayatollah Ali Khamenei congratulated Mr Rouhani on his victory.