Rohani's resounding election win in June raised hopes of a negotiated end to the dispute over Iran's nuclear program. That would avert a possible new war in the Middle East.
Khamenei endorsed Rohani's election win in a statement read out to political, religious and military grandees assembled at a Tehran religious site.
- Rohani becomes Iran's president after Khamenei's endorsement
- Report: On eve of Rohani inauguration, Iran's economic crisis worsens
- Iran's Ahmadinejad warns Israel will be 'uprooted'
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."
Symbolising 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.
In his first speech as president, broadcast live on state television, Rohani said "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."
"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."
The start of Rohani's presidency puts an end to Ahmadinejad's eight years in office during which Iran grew more isolated and came under wide-ranging United Nations, US and European Union sanctions over its nuclear program, putting enormous pressure on the economy.
Rohani faces huge challenges, including combating inflation he put last month at 42%, bringing down high unemployment and bridging the political divisions between conservative, moderate and reformist factions.
His most immediate test is persuading parliament to approve his candidates for cabinet positions, which he is expected to introduce on Sunday after he takes the oath of office.
"Rohani 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 Rohani can get the economy moving again."
Reuters, AFP contributed to the report
- Receive Ynetnews updates
directly to your desktop