Imran Khan met both US President Trump and Iranian President at the UN.

Pakistani Prime Minister Imran Khan said Tuesday that both the United States and Saudi Arabia asked him to mediate with Iran to defuse tensions.

Khan met both US President Donald Trump and Iranian President Hassan Rouhani at the United Nations, before which he visited Crown Prince Mohammed bin Salman in Saudi Arabia.

"Trump asked me that if we could de-escalate the situation and maybe come up with another deal," Khan told reporters.

"Yes, we did convey this, and yes, we're trying our best," he said.

"I immediately spoke to President Rouhani yesterday after the meeting with President Trump. I can't say anything right now more than this except that we're trying and mediating," he said.

In Saudi Arabia, which was hit earlier this month by attacks on its oil infrastructure blamed on Iran, Crown Prince Mohammed "also asked me to talk to the Iranian president," Khan said.

Pakistan traditionally has strong relations with Saudi Arabia but also maintains ties with Iran, with Islamabad representing Tehran's consular interests in the United States in the absence of diplomatic relations.

The leaders of France, Germany and Japan were all also meeting with both Rouhani and Trump at the United Nations in hopes of reviving diplomacy.