Imran Khan has travelled to Iran in an attempt to defuse tensions in its stand-off with Saudi Arabia.
Pakistan's prime minister flew to its neighbour on Sunday for meetings with the Iranian leadership “as part of his initiative to promote peace and security in the region”.
Mr Khan landed in Tehran and was greeted at the airport by Foreign Minister Mohammad Javad Zarif before going into a meeting with Rouhani.
The former cricketer hopes to mediate between the Gulf adversaries after Donald Trump asked him to intervene to lower tensions.
Iran and Saudi Arabia's rivalry has appeared in danger of descending into outright conflict after a drone and cruise missile attack on two Saudi oil facilities cut global supply by five per cent and sent prices soaring.
Saudi and US officials both blame Iran for the attack, while France, Germany and the UK have said in a joint statement there was no other plausible explanation.
Iran denies being behind the attack, which was claimed by Iran-aligned Houthi rebels.
America has said it will deploy thousands of extra troops and fighter jets to "enhance the defence of Saudi Arabia" in the face of "Iranian aggression".
Mr Khan has repeatedly offered to mediate between the nations. At last month's United Nations General Assembly, he said Mr Trump had asked him to intervene in the crisis.
Mr Trump said at the time “we have a very good relationship and there’s a chance that that could happen”. He went on: “A lot of people would like to get us to the table. We’ll see what happens but so far we have not agreed to a meeting.”
Mr Khan will also meet Supreme Leader Ayatollah Ali Khamenei.
“Besides issues relating to peace and security in the Gulf, bilateral matters and important regional developments will be discussed,” a statement from Pakistan's foreign ministry said.
His trip comes a day after Iran's foreign ministry said on Sunday that the country was prepared to “talk with its neighbours, including Saudi Arabia, to get rid of any misunderstandings”.
Abbas Mousavi, a spokesman for the ministry, told the state broadcaster he was not aware of Mr Khan’s intention to act as a mediator but explained: “Iran has announced that, with or without a mediator, it is always ready to hold talks”.
Mr Khan is expected to fly to Riyadh for talks soon afterwards, but is also expected back in Islamabad early this week to meet a Royal visit by the Duke and Duchess of Cambridge.
Mr Khan has repeatedly offered its diplomatic services to help America, Farzana Shaikh, a Pakistan expert at the Chatham House think tank said, but it was unclear whether he could act as a broker between Tehran and Riyadh.
“Pakistan's relations with Saudi Arabia are close, but those with Iran are much more uneasy,” she said.
“But I think it is being seen as an effort worth making only because President Trump appears to have expressed an interest in this kind of mediation, only because I think Pakistan is keen in some sense to show that it can play the role of a mature, peacemaker.”
Iran last week said missiles struck one of its tankers in the Red Sea. The tanker, the Sabiti, was damaged on Friday near the Saudi port of Jeddah. Saudi Arabia said it had offered to help the vessel but the vessel rejected any assistance.
Tension in the region has been rising steadily since Mr Trump reimposed sanctions and pulled out of an international nuclear deal with Tehran. Saudi Crown Prince Mohammed Bin Salman last month gave a warning that a conflict with Iran would lead to a “total collapse of the global economy”. Friday's incident saw a spike in oil prices.