President Donald Trump gestures while speaking during a meeting with members of his cabinet at the White House in Washington. Picture: Pablo Martinez Monsivais/AP

Washington - US President Donald Trump warned Iranian President Hassan Rouhani on Sunday not to threaten the United States or face the consequences, hours after Rouhani told Trump that hostile policies toward Tehran could lead to "the mother of all wars."

In a late night Twitter 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!"

The escalation in rhetoric came as the Trump administration has launched an offensive of speeches and online communications meant to foment unrest and help pressure Iran to end its nuclear program and its support of militant groups, according to US officials familiar with the matter.

Iran has faced increased US pressure and looming sanctions following Trump's decision to withdraw the United States from a 2015 international deal over Iran's nuclear program. Tehran has said its nuclear work is just for electricity generation and other peaceful projects.

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.

Addressing a gathering of Iranian diplomats earlier on Sunday, Rouhani said: "Mr Trump, don't play with the lion's tail, this would only lead to regret," according to a report by the state news agency IRNA.

Iran's President Hassan Rouhani attends a news conference. File picture: Lisi Niesner/Reuters

"America should know that peace with Iran is the mother of all peace, and war with Iran is the mother of all wars," Rouhani said, leaving 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.

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.

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.