The United States blames Iran for an attack on the world's biggest crude oil processing facility in Saudi Arabia on Sept. 14 and has said they will present evidence to back that up. Yemen's Iran-aligned Houthi group, which has been fighting a Saudi-led military coalition since 2015, has claimed responsibility. Iran denies involvement.
Khan met with Trump on the sidelines of the annual gathering of world leaders at the United Nations on Monday.
"I immediately spoke to President Rouhani yesterday after the meeting with President Trump, but I can't say anything right now more than this except that we're trying and mediating," Khan told reporters at the United Nations on Tuesday.
Khan said he had been in Saudi Arabia before New York and spoken with Prince Mohammed bin Salman who also asked him to talk to Rouhani.
An already-tense relationship between Iran and the United States has worsened over the past year since Trump withdrew from a 2015 nuclear pact between Iran and world powers, saying it did not go far enough, and reimposed sanctions on Iran as part of a "maximum pressure" policy.
In response, Iran has gradually reduced its commitments to limit uranium enrichment activity under the pact and plans further breaches if European parties fail to keep their promises to shield Iran's economy from U.S. sanctions.
In his speech to the U.N. on Tuesday, Trump said there was a path to peace with Iran while he denounced its leadership for "bloodlust."
When asked about Khan's remarks, Trump said Khan would like to mediate "and we have a very good relationship and there's a chance that that could happen."
"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," Trump said on a possible meeting with Rouhani while they are both in New York this week.
Khan also said he had told Trump that he was willing to help broker peace in neighboring Afghanistan.
Hundreds of civilians have been killed in fighting across Afghanistan after the collapse of U.S.-Taliban peace talks this month. The Taliban has said Trump would regret his decision to abruptly call off talks that could have led to a political settlement to end the 18-year-old war.
"We are trying now to get the talks restarted between Taliban and the Americans and hopefully the deal is signed," Khan said.
"Then I will try and meet the Taliban to convince them to talk to the Afghan government because until now that's where the hitch was - Taliban were talking to the Americans but not to the Afghan government," he said.