Donald Trump has warned Hassan Rouhani, the Iranian president, to never threaten the US again, saying he would not "stand for your demented words".
The US president issued the direct threat on Twitter after the Iranian leader cautioned Mr Trump about pursuing hostile policies against Tehran, saying "war with Iran is the mother of all wars".
A war of words has escalated as Iran faces increased US pressure and looming sanctions after Mr Trump's decision to withdraw the United States from a 2015 international deal over Iran's nuclear programme.
The rhetoric echoes the threats exchanged between Mr Trump and North Korean leader Kim Jong-un before relations thawed earlier this year. It came after US Secretary of State Mike Pompeo compared Iran's leaders to a "mafia" and promised unspecified backing for Iranians unhappy with their government.
Using capital letters, Mr Trump told Mr Rouhani to "be cautious".
To Iranian President Rouhani: NEVER, EVER THREATEN THE UNITED STATES AGAIN OR YOU WILL SUFFER CONSEQUENCES THE LIKES OF WHICH FEW THROUGHOUT HISTORY HAVE EVER SUFFERED BEFORE. WE ARE NO LONGER A COUNTRY THAT WILL STAND FOR YOUR DEMENTED WORDS OF VIOLENCE & DEATH. BE CAUTIOUS!
— Donald J. Trump (@realDonaldTrump) July 23, 2018
Addressing a gathering of Iranian diplomats at the weekend, Mr Rouhani left open the prospect for peace. But he warned: "Mr Trump, don't play with the lion's tail, this would only lead to regret."
"America should know that peace with Iran is the mother of all peace, and war with Iran is the mother of all wars," Mr Rouhani said, according to the state new agency IRNA.
"You are not in a position to incite the Iranian nation against Iran's security and interests," Mr Rouhani said, in an apparent reference to reported efforts by Washington to destabilise Iran's Islamic government.
In Washington, US officials familiar with the matter told Reuters that the Trump administration had launched an offensive of speeches and online communications meant to foment unrest and help pressure Iran to end its nuclear programme and its support of militant groups.
Current and former US officials said the campaign painted Iranian leaders in a harsh light, at times using information that is exaggerated or contradicts other official pronouncements, including comments by previous administrations.
Mr Rouhani scoffed at Mr Trump's threat to halt Iranian oil exports and said Iran has a dominant position in the Gulf and the Strait of Hormuz, a major oil shipping waterway.
"Anyone who understands the rudiments of politics doesn't say 'we will stop Iran's oil exports'...we have been the guarantor of the regional waterway's security throughout history," Rouhani said, cited by the semi-official ISNA news agency.
Iran's Supreme Leader Ayatollah Ali Khamenei on Saturday backed Rouhani's suggestion that Iran may block Gulf oil exports if its own exports are halted.
Iran nuclear deal | Related content
Mr Rouhani's apparent threat earlier this month to disrupt oil shipments from neighbouring countries came in reaction to efforts by Washington to force all countries to stop buying Iranian oil.
Iranian officials have in the past threatened to block the Strait of Hormuz in retaliation for any hostile US action.
On Sunday, Iran's ground forces commander became the latest military figure to back Mr Rouhani's apparent threat, the semi-official news agency Tasnim reported.
"The Strait of Hormuz region must either be safe for all or be insecure for everyone," said General Kioumars Heydari, quoted by Tasnim.
Separately, a top Iranian military commander warned that the Trump government might be preparing to invade Iran.
"The enemy's behaviour is unpredictable," Tasnim quoted military chief of staff General Mohammad Baqeri as saying.
"Although the current American government does not seem to speak of a military threat, according to precise information it has been trying to persuade the U.S. military to launch a military invasion (of Iran)," Baqeri said.
Iran's oil exports could fall by as much as two-thirds by the end of the year because of new US sanctions, putting oil markets under huge strain amid supply outages elsewhere.
Washington initially planned to shut Iran out of global oil markets completely after Mr Trump abandoned the deal that limited Iran's nuclear ambitions, demanding all other countries stop buying Iranian crude by November.
But the United States has somewhat eased its stance, saying it may grant sanction waivers to some allies that are particularly reliant on Iranian supplies.
Mr Pompeo said on Sunday that Iran "is run by something that resembles the mafia more than a government," Pompeo said, citing what he called Iranian leaders' vast wealth and corruption.
Mr Trump and Mr Pompeo's comments are the latest step in a communications offensive launched by the Trump administration that is meant to foment unrest in Iran and help pressure its government to end its nuclear program and support of militant groups, US officials familiar with the matter said.
The offensive is meant to work in concert with severe economic sanctions that Washington plans to reimpose in the coming months, including on Tehran's oil exports, its principal revenue generator.
The United States will work with countries that import Iranian oil "to get imports as close to zero as possible" by Nov. 4, Mr Pompeo said.
After Mr Trump's warnings overnight the head of Iran's Basij militia, part of the Revolutionary Guard, on Monday dismissed the threats as "psychological warfare", local media reported.
"Trump's statements against Iran are psychological warfare. He is not in a position to act against Iran," said General Gholam Hossein Gheypour, according to the semi-official ISNA news agency.
Israeli Prime Minister Benjamin Netanyahu on Monday praised Mr Trump's "tough stand" against Iran.