A picture provided by the Saudi Royal Palace shows Crown Prince Mohammed bin Salman (R) during his meeting with Pakistan's Prime Minister Imran Khan in the capital Riyadh on October 15, 2019
A picture provided by the Saudi Royal Palace shows Crown Prince Mohammed bin Salman (R) during his meeting with Pakistan's Prime Minister Imran Khan in the capital Riyadh on October 15, 2019 Saudi Royal Palace / Bandar AL-JALOUD

Pakistan's foreign minister said Tuesday that Prime Minister Imran Khan's talks with Tehran and Riyadh had been "encouraging" after visits to try to defuse rising tensions in the Gulf.

Khan travelled to Iran and Saudi Arabia as a "facilitator" between the arch-rivals, following a series of attacks on oil infrastructure and tankers in recent months that have raised fears of war.

"Our talks have been encouraging and the response that we got in the two countries was beyond our expectation," Foreign Minister Shah Mehmood Qureshi told a press conference in Islamabad after Khan's visit to Riyadh.

"Iranian leadership told us they don't want escalation and wish to resolve the issue peacefully," he said.

Iran's leaders "said they are also mentally prepared for a dialogue, either direct or with third-party facilitation", Qureshi added.

Earlier this week Khan held talks with Iranian President Hassan Rouhani at the presidential palace and later met Iran's supreme leader Ayatollah Ali Khamenei.

It was Khan's second visit this year to Iran, which shares a border of about 1,000 kilometres (620 miles) with Pakistan.

Tensions in the Gulf spiked last month after attacks on Saudi oil facilities that halved the kingdom's crude output and set oil markets alight.

Tehran has denied involvement and warned of "total war" in the event of any attack on its territory.

On Tuesday, Khan went to Riyadh and met King Salman bin Abdulaziz and Crown Prince Mohammad bin Salman.

"

"I am quite satisfied to say that the clouds of war and conflicts that hovered lately are clearing," he added.

"A good beginning has been made... There is a mechanism to move forward and we are engaged in discussion on this."

Pakistan has strong relations with Saudi Arabia, with more than 2.5 million of its nationals living and working in the kingdom, but it also maintains good relations with Iran and represents Tehran's consular interests in the United States.