Fresh from securing the lifting of international sanctions imposed over Iran's nuclear programme, Rouhani spent 40 minutes at the Vatican talking privately to Pope Francis, a strong backer of the deal with Tehran.
In a statement afterwards, the Vatican said Francis had urged the Iranian leader to use Iran's important role to promote, together with other countries, "adequate political solutions" to the problems afflicting the region and to help combat terrorism and arms trafficking.
"I thank you for your visit and I hope for peace," Francis told his guest at the end of their meeting, when journalists were briefly allowed to listen in.
A smiling Rouhani, who presented the pope with a hand-made carpet from the ancient city of Qom, replied with one of Francis's catchphrases.
"I ask you to pray for me," he said. "It was a pleasure to meet you and I wish you well in your work."
In return for his gift, Rouhani was given a medal depicting St Martin cutting his cloak in half to give to a poorly clothed beggar.
The Iranian leader also went away with English and Arabic versions of Francis's extended essay on the environmental challenges faced by the world. "Laudato Si" (Praise Be) has not been translated into Farsi.
It was the first official visit to the Vatican by an Iranian president since Mohammad Khatami was hosted by John Paul II in 1999. Khatami also attended the Polish pope's funeral in 2005.
Rouhani is on a five-day trip to Italy and France looking to drum up trade and investment to modernise Iran's economy, partly by pitching the country as a beacon of stability in a conflict-wracked region.
SAFE AND STABLE
Signup to our newsletter and follow us on Facebook and Twitter!
Speaking to an audience of Italian and Iranian business leaders earlier in the day, Rouhani also portrayed Iran as the ideal base for companies seeking a foothold in a region of 300 million people, reassuring would-be investors their contracts would be honoured.
"Iran is the safest, the most stable country in the entire region," Rouhani said.
"Everyone understood that the nuclear negotiations represented a win-win situation for both sides.
"Now we have created the conditions for investment and for the transfer of know-how. There has to be an advantage for both sides: we invite you to invest and we will provide stability and ensure that you can make adequate returns."
He emphasised that all sections of Iran's often-divided political class, right up to supreme leader Ayatollah Ali Khamenei, were firmly behind the post-sanctions drive to secure the trade and investment needed to create new roads, rail links, airports and other infrastructure.
Rouhani outlined a vision of Iran being transformed into a hub for intra-regional economic development, linking the Middle East to South and Central Asia and even the Western fringes of China.
"Do not regard us as just one country but as a country at the centre of a much larger market," Rouhani said, citing the example of the port of Chabahar on Iran's southern coast.
Iran is seeking international investment to help complete a port which will provide a gateway for Indian companies seeking to do business in Afghanistan and Central Asia, as well as in Iran.
Rouhani also pledged that Tehran would do nothing to jeopordise its stability and said economic growth could help beat terrorism in the region.
"We have no intention of attacking or invading any other country. We have no intention of interfering in the affairs of any other country," he said.
"A lack of development creates the conditions for extremism, unemployment recruits soldiers for terrorism."