The 64-year-old former nuclear negotiator, who has committed himself to greater international engagement for Iran which is battling sanctions over its nuclear programme, was administered the oath in the Parliament by Sadeq Larijani, the head of the country's judicial system.
Rouhani was officially endorsed by the supreme leader Ayatollah Ali Khamenei yesterday for a four-year term.
Rouhani said that his country opposes any government and political change through the use of force, oppression, hegemony and military intervention.
Rouhani takes over the Presidentship at a time when western nations are stepping up pressure on Iran, accusing it of pursuing a nuclear programme as a cover for a drive for a weapons capability.
Also Read
Iran insists that its programme is for peaceful purposes such as power generation and medical purposes only.
"If you want a proper answer, do not speak with Iran with the language of sanctions but with the language of respect," he said, adding Iran would "not surrender to sanctions, nor be threatened with war."
Reflecting warm bilateral ties, Ansari flew into the Iranian capital by a special plane to represent India at the ceremony. He was welcomed by deputy foreign minister Abbas Garchy.
Ansari, who was earlier India's ambassador to Iran, also met Ali Larijani, speaker of the Majlis.
Soon after his victory in the June 14 Presidential polls, Rouhani had pledged to expand relations with India calling it his foreign policy priority. He visited India in 2002.