Hassan Rouhani has hailed his election as Iran's president as a "victory of moderation over extremism".
The reformist-backed cleric won just over 50% of the vote and so avoided the need for a run-off.
Thousands of Iranians took to the streets of Tehran when the result was announced, shouting pro-reform slogans.
The US expressed concern at a "lack of transparency" and "censorship" but praised the Iranian people and said it was ready to work with Tehran.
Israeli Prime Minister Benjamin Netanyahu urged continued international pressure on Iran to curb its nuclear programme.
"The international community must not give in to wishful thinking or temptation and loosen the pressure on Iran for it to stop its nuclear programme," Mr Netanyahu told his cabinet, according to a statement released by his office.
Some 72.2% of the 50 million eligible voters cast ballots on Friday to choose the successor to Mahmoud Ahmadinejad.
Mr Rouhani issued a statement saying that "a new opportunity has been created for those who truly respect democracy, interaction and free dialogue".
The 64-year-old cleric said: "I thank God that once again rationality and moderation has shone on Iran... This victory is a victory for wisdom, moderation and maturity... over extremism."
But he also said: "The nations who tout democracy and open dialogue should speak to the Iranian people with respect and recognise the rights of the Islamic republic."
Supreme Leader Ayatollah Ali Khamenei congratulated Mr Rouhani on his victory, saying: "I urge everyone to help the president-elect and his colleagues in the government, as he is the president of the whole nation."
Ayatollah Khamenei will ratify the vote on 3 August and the new president will then take the oath in parliament.
There were scenes of celebration in the capital, as thousands of people, many sporting Mr Rouhani's election colour of purple, took to the streets.
Security officials stood by but did not intervene as crowds chanted: "Long live Rouhani."
After the last presidential election in June 2009, millions of Iranians took to the streets to demand a re-run, when the supreme leader dismissed claims by the three defeated candidates of widespread fraud.
On Saturday, some chants were heard calling for the release of political prisoners, a policy Mr Rouhani appears to support.
One of Mr Rouhani's main election pledges was to try to ease international sanctions imposed on Iran over its nuclear programme.
Iran has been suffering economic hardship, with rising unemployment, a devalued currency and soaring inflation.
But although Mr Rouhani has pledged greater engagement with Western powers, correspondents warn that power remains in the hands of the ruling clerics and the Revolutionary Guard.
The US said it respected the vote and would "engage Iran directly" to find a "diplomatic solution that will fully address the international community's concerns about Iran's nuclear programme".
But White House spokesman Jay Carney did congratulate Iranians for their courage in voting.
The UK Foreign Office urged Mr Rouhani to "set Iran on a different course for the future: addressing international concerns about Iran's nuclear programme... and improving the political and human rights situation for the people of Iran".
France said it was "ready to work" with the new leader, while Russian President Vladimir Putin urged him to forge closer ties with Moscow.
Surge of support
Mr Rouhani, who has held several parliamentary posts and served as chief nuclear negotiator, had not been an obvious landslide winner.
The surge of support for him came after Mohammad Reza Aref, the only reformist candidate in the race, announced on Tuesday that he was withdrawing on the advice of pro-reform ex-President Mohammad Khatami.
Mr Rouhani thus went into polling day with the endorsement of two ex-presidents - Mr Khatami and Akbar Hashemi Rafsanjani, who was disqualified from the race by the powerful Guardian Council, a 12-member body of theologians and jurists.
In the end, Mr Rouhani won 18,613,329 of the 36,704,156 votes cast. This represented 50.71% of the vote, giving him enough to avoid a run-off.
Tehran Mayor Mohammad Baqer Qalibaf won 6,077,292 votes to take second place (16.56%).
Saeed Jalili came third and Mohsen Rezai fourth.