Hassan Rouhani took office as Iran's president on Saturday promising "constructive interaction with the world" after eight years under Mahmoud Ahmadinejad marked by diplomatic confrontation and damaging sanctions.
The politically moderate 64-year-old cleric's resounding victory at June's election raised hopes of a negotiated end to the dispute over Iran's nuclear program and an easing of the sanctions that have hit the OPEC country's oil exports.
That could avert a possible new war in the Middle East. Both the United States and Israel have said all options - including military action - are open to stop Iran getting nuclear arms.
Supreme Leader Ayatollah Ali Khamenei endorsed Rouhani's election win in a statement read out to political, religious and military grandees assembled at a Tehran religious site.
Khamenei praised the "selection of a worthy individual who has more than three decades of service to the system of the Islamic Republic ... and who from the time of the revolutionary struggle ... has resisted the enemies of the Islamic Revolution."
Symbolizing the handover of power, Khamenei took the presidential mandate from Ahmadinejad and handed the document to Rouhani.
Khamenei then kissed Rouhani on the cheek and the new president kissed the leader on his shoulder, a sign of supplication.
The start of Rouhani's presidency puts an end to the Ahmadinejad era during which Iran grew more isolated and came under wide-ranging United Nations, US and European Union sanctions over its nuclear program.
Rouhani faces enormous challenges, including inflation he put last month at 42 percent, unemployment, and political divisions between conservative, moderate and reformist factions.
"Moderation does not mean deviating from principles and it is not conservatism in the face of change and development. Moderation ... is an active and patient approach in society in order to be distant from the abyss of extremism," Rouhani said in a short speech after becoming president.
"In the international arena we will also take new steps to promote the Iranian nation towards securing national interests and removing sanctions. Although there are many limitations, the future is bright and promising," he said.
"The orientation of the government is Iran's economic salvation, constructive interaction with the world, and a restoration of morality."
Rouhani's first test is persuading parliament to approve his list of proposed ministers, which he is expected to present on Sunday after he takes his oath of office in parliament.
"Rouhani will certainly appoint more competent men and women to key economic ministries and institutions. He will also follow saner economic policies," said Shaul Bakhash, an Iran historian at George Mason University in Virginia.
"But the economic problems are staggering ... Above all, without a serious easing of sanctions, it is difficult to see how Rouhani can get the economy moving again."
Ahmadinejad defended his time in office, telling state television late on Friday his administration was the least corrupt in history, and blaming sanctions for economic problems.
"We promised to have clean hands; I say with confidence that this government is the cleanest government," Ahmadinejad said, according to the Mehr news agency.
"The enemy has introduced heavy sanctions and the nation has faced problems. We have made our utmost effort but we couldn't resolve all the pressures. This issue has been very difficult for us."
Rouhani has said he will appoint ministers from all political factions, based on their ability, but hardliners have demanded the conservative-dominated parliament reject nominees associated with the "sedition", their term for the months of protests that followed Ahmadinejad's disputed 2009 re-election.
Parliament's confirmation of such candidates would be "a betrayal of the people and the system," Hossein Shariatmadari, editor of the influential hardline daily Kayhan, wrote in an editorial this week.
A source close to Rouhani confirmed to Reuters that he will nominate Mohammad Javad Zarif, a US-educated former ambassador to the United Nations, as his foreign minister.
Another likely pick is Ali Jannati for culture minister, an influential post which oversees domestic and foreign press in Iran and vets cinema, theater, literature and other arts. Jannati has served as ambassador to Kuwait and his father is Ayatollah Ahmad Jannati, a hardline cleric.
During Ahmadinejad's presidency, press freedoms were curtailed, newspapers shut down, and this year about a dozen journalists were arrested in a crackdown on the press.
In an interview with the reformist Bahar newspaper this week, Jannati sought to distance himself from his father's views and indicated he would support more freedom for artists.
"Intellectual matters are not hereditary," Jannati said, according to Bahar. "I am hopeful that given my views on the fields of music, art, and film, the cultural and artistic atmosphere in the country will soften so that artists can breathe more easily."