Iran has warned that new US sanctions targeting its supreme leader mean “closing the doors of diplomacy” between Tehran and Washington as President Hassan Rouhani derided the White House as being “afflicted by mental retardation”.

President Donald Trump called that a “very ignorant and insulting statement”, tweeting that an Iranian attack on any US interest will be met with “great and overwhelming force … overwhelming will mean obliteration”.

Later, Mr Trump insisted that Iran still takes his threats seriously, even after he decided not to approve retaliatory air strikes.

Mr Trump told reporters in the Oval Office that when the Iranians are ready to talk, they will contact him.

Speaking in Israel, US national security adviser John Bolton said Iran could walk through an “open door” to talks with America, but warned that “all options remain on the table” if Tehran carries through its vow to break its 2015 nuclear deal with world powers.

“The useless sanctioning of Islamic Revolution Supreme Leader (Ali Khamenei) and the commander of Iranian diplomacy means closing the doors of diplomacy by the U.S.’ desperate administration,” Iranian Foreign Ministry spokesman Abbas Mousavi tweeted.

“Trump’s government is annihilating all the established international mechanisms for keeping peace and security in the world.”

The US president enacted the new sanctions against Mr Khamenei and his associates on Monday.

US officials also said they plan sanctions against foreign minister Mohammad Javad Zarif, something that drew Mr Rouhani’s anger during his televised address Tuesday.

“You sanction the foreign minister simultaneously with a request for talks,” he said.

He called the sanctions against Mr Khamenei “outrageous and idiotic”, especially since the 80-year-old supreme leader has no plans to travel to the US.

“The White House is afflicted by mental retardation and does not know what to do,” he added.

US secretary of state Mike Pompeo said he had not heard Mr Rouhani’s reaction to the new sanctions, but added that if the reports were true, “that’s a bit immature and childlike”.

“But know that the United States will remain steadfast in undertaking the actions that the president laid out in this strategy to create stability throughout the Middle East, which includes the campaign we have, the economic campaign, the pressure campaign that we have on the Islamic Republic of Iran,” he added.

The crisis gripping the Middle East stems from Mr Trump’s withdrawal of the US a year ago from the nuclear deal with Iran and other world powers and then imposing crippling new sanctions on Tehran.

Recently, Iran quadrupled its production of low-enriched uranium to be on pace to break one of the deal’s terms by Thursday, while also threatening to raise enrichment closer to weapons-grade levels on July 7 if European countries still abiding by the accord do not offer a new deal.

Citing unspecified Iranian threats, the US has sent an aircraft carrier to the Middle East and deployed additional troops alongside the tens of thousands already there.

All this has raised fears that a miscalculation or further rise in tensions could push the US and Iran into an open conflict, 40 years after the Islamic Revolution.

The sanctions followed Iran’s downing on June 20 of a US surveillance drone, worth over 100 million dollars (£78 million), above the Strait of Hormuz, sharply escalating the crisis.

Mr Trump then said he pulled back from the brink of retaliatory military strikes but continued his pressure on Iran.

Ms Mousavi’s statement echoed that of Iran’s UN ambassador, Majid Takht Ravanchi, who warned on Monday that the situation in the Persian Gulf was “very dangerous” and said any talks with the US were impossible in the face of escalating sanctions and intimidation.

Meanwhile, the US envoy at the United Nations, Jonathan Cohen, said the Trump administration’s aim is to get Tehran back to negotiations.