Mr Rouhani's election has been endorsed by Supreme Leader Ayatollah Ali Khamenei at a ceremony in the capital, Tehran.
He won the presidential poll in June, promising to reform and to put an end to Iran's international isolation.
The ceremony marks the handover of power, but his public inauguration does not take place until Sunday.
The 64-year-old is a former nuclear negotiator for Iran and was an Islamic activist before the 1979 Revolution.
Speaking at the ceremony, Mr Rouhani said: ''I have assumed this responsibility with the support of those people who want change, who want a better life, away from corruption, poverty and discrimination, people who want more respect and dignity, and hope in a secure future."
He has the support of Iran's reform movement, which wants the new president to release political prisoners and have international sanctions lifted.
But while he may be taking over as president, he will not be Iran's main decision-maker, says the BBC's Iran correspondent James Reynolds in London.
Rouhani inauguration: Iranian voices
Profile: Hassan Rouhani
In the Islamic Republic, it is the Supreme Leader, not the president, who has the final say, our correspondent adds.
The day before he took office, Mr Rouhani called Israel an "old wound on the body of the Islamic world", as Iran marked its annual Jerusalem (Quds) Day.
His remarks echo those of other Iranian leaders on the day dedicated to supporting the Palestinians and denouncing Israel.
Iran has denied Israel's right to exist since the 1979 Islamic revolution.
In his last interview before stepping aside on Friday, Mr Ahmadinejad also attacked Israel, warning of "storm brewing" in the region that would uproot Zionism, according to AFP news agency.
Many Iranians believe Mr Ahmadinejad, elected twice in controversial polls, has put Iran on the path to economic ruin and confrontation with the outside world.
Correction 23 August 2013: This story has been amended to make clear that Hassan Rouhani's remarks on Jerusalem Day alluded to the state of Israel, rather than just areas under its occupation.
Cleric Hassan Rouhani has officially replaced Mahmoud Ahmadinejad as president of Iran.