In a message, delivered through Oman overnight, Iranian officials told Reuters that Tehran had received a message from US President Donald Trump warning that a US attack on Iran was imminent but saying he was against war and wanted talks.
News of the message came shortly after the New York Times said Trump had approved military strikes against Iran on Friday over the downing of a US surveillance drone, but called them off at the last minute.
"In his message, Trump said he was against any war with Iran and wanted to talk to Tehran about various issues," one of the officials told Reuters, speaking on condition of anonymity.
"He gave a short period of time to get our response but Iran's immediate response was that it is up to Supreme Leader (Ayatollah Ali) Khamenei to decide about this issue," the source said.
A second Iranian official said: "We made it clear that the leader is against any talks, but the message will be conveyed to him to make a decision.
"However, we told the Omani official that any attack against Iran will have regional and international consequences."
After weeks of rising tension following a spate of attacks on oil tankers in the Gulf region, Iran said on Thursday it had shot down an unmanned US military surveillance drone with a surface-to-air missile.
Trump indicated after the drone's downing that he was not eager to escalate a stand-off with Iran over its nuclear and ballistic missile activities and support for proxies in various Middle East conflicts.
He said the unmanned drone may have been shot down in error by someone who was acting "loose and stupid," though added: "This country will not stand for it."
The incident aggravated global fears of direct military confrontation between the longtime foes, and oil prices rose a further $1 per barrel to above $65.50 on Friday due to worries about possible disruptions to crude exports from the Gulf.
The New York Times quoted a senior administration official as saying US warplanes took to the air and ships were put in position for a retaliatory attack on Iran, only for an order to come to stand down without any weapons being fired.
Targets had included Iranian radar and missile batteries, the paper cited senior administration officials involved in, or briefed on, the deliberations, as saying.
The strikes were set for early in the day to minimize risk to the Iranian military or to civilians, the Times added. It was unclear if attacks on Iran might go ahead later, it said.
Russia accused the United States of deliberately stoking dangerous tensions around Iran and pushing the situation to the brink of war, and urged all sides to show restraint.
Russian Deputy Foreign Minister Sergei Ryabkov called on Washington to weigh the possible consequences of conflict and said the Times report showed the situation was extremely dangerous.
Some global airlines re-routed flights to avoid Iran-controlled airspace over the Strait of Hormuz and Gulf of Oman after the US Federal Aviation Administration barred US carriers from the area until further notice.
Tensions with Iran have increased since Trump's withdrawal last year from the 2015 nuclear accord with Iran, signed by six world powers including the United States. Trump has denounced it as flawed to Tehran's advantage.
Washington then imposed fresh sanctions to throttle Iran's vital oil trade and Iran retaliated earlier this week by threatening to breach limits on its uranium enrichment program set by the nuclear deal.
The sanctions have pounded Iran's economy, scuttled its vital oil exports and barred it from the dollar-dominated global finance system, dimming the promise of a trade bonanza for Tehran for having curbed its nuclear capabilities under UN monitoring.
Iran fires back
Iran said it shot down the unarmed Global Hawk surveillance drone while it was spying over part of its coastal territory, and state television on Friday showed what it said were retrieved sections of the aircraft.
Washington said the drone was downed over international airspace in the Strait of Hormuz. Independent confirmation of the drone's location when it was brought down was not immediately available.
The drone's destruction exacerbated tensions in the Gulf, a critical artery for global oil supplies where six tankers have been damaged by explosions in the past six weeks.
Iran has denied US and Saudi accusations it was behind the tanker attacks and accused Washington of "warmongering."
"The US wants the current Iranian regime to come to the negotiating table and to stop their support for terrorism, pursuit of ballistic missiles, nuclear program cover-ups and human rights abuses," tweeted US Ambassador to Germany Richard Grenell. "Our European partners share these goals."
European powers — fellow signatories of the nuclear deal with Iran — say more evidence is needed to pinpoint responsibility for the tanker strikes.
They have sought to keep the nuclear deal alive despite the US exit, but Tehran has told them and other world powers who signed the accord that they must rein in Trump's aggressive stance toward Iran or it too will bow out of the deal.
Additional reporting by Babak Dehghanpisheh in Geneva, Jamie Freed in Singapore, David Shepardson in Washington and Tom Westbrook in Sydney, Tom Balmforth in Moscow, Roberta Rampton and Phil Stewart in Washington; Writing by Mark Heinrich; Editing by Jon Boyle.