In a late night message on Twitter, US President Donald Trump told Iran it risked consequences "the like of which few throughout history have suffered before" if the Islamic Republic made more threats against the United States.
The tweet came hours after Iranian President Hassan Rouhani told Trump that hostile policies toward Tehran could lead to "the mother of all wars."
The heightened rhetoric follows the Trump administration's launch of an offensive of speeches and online communications meant to foment unrest and pressure Iran to end its nuclear program and its support of militant groups, according to US officials.
Iran has faced increased US pressure and possible sanctions since Trump's decision to withdraw the United States from a 2015 international agreement over Iran's nuclear program.
In his message directed at Rouhani, Trump wrote: "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!".
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
Earlier on Sunday, Rouhani had told a gathering of Iranian diplomats: "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," said Rouhani, quoted by the state news agency IRNA.
Rouhani left open the possibility of peace between the two countries, at odds since the 1979 Islamic Revolution.
Rouhani also scoffed at 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.
A senior commander of Iran's elite Revolutionary Guards reacted to Trump's threats by saying Tehran would continue to resist its enemies, Iran's Students news Agency ISNA reported.
"We will never abandon our revolutionary beliefs ... we will resist pressure from enemies ... America wants nothing less than (to) destroy Iran ... (but) Trump cannot do a damn thing against Iran," Brigadier General Gholamhossein Gheybparvar said.
In a speech late on Sunday, US Secretary of State Mike Pompeo denounced Iran's leaders as a "mafia" and promised unspecified backing for Iranians unhappy with their government.
Tehran denounced Pompeo's speech as an interference in Tehran's affairs, the semi-official Tasnim news agency reported.
"Such policies will unite Iranians who will overcome plots against their country," Iranian Foreign Ministry spokesman Bahram Qasemi said.
With popular discontent over Iran’s faltering economy and sliding currency, and the prospect of tough new US sanctions, Iran's leaders have called for unity.
Many ordinary Iranians are largely skeptical of the Trump administration's support for Iranian citizens because of the harsh US sanctions on the country and a visa ban imposed on Iranians barring them from entering the United States.
Rouhani's apparent threat earlier this month to disrupt oil shipments from neighboring countries came in reaction to efforts by Washington to force all countries to stop buying Iranian oil.
Washington initially planned to shut Iran out of global oil markets completely after 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.
Iran has threatened to block oil shipments from the Strait of Hormuz in the Gulf if countries heed US calls to stop buying Iranian oil under US pressure.
By Warren Strobel and Parisa Hafezi/Reuters
Reporting by Brendan O'Brien and Warren Strobel, additional reporting by Parisa Hafezi in Ankara, Dubai newsroom; Writing by Daniel Wallis; Editing by Angus MacSwan.