WASHINGTON — President Trump has warned Iranian President Hassan Rouhani that he will face dire consequences for threatening the United States.

Trump tweeted late on Sunday about the dangers to Iran of making hostile threats after Rouhani said Sunday ‘‘American must understand well that peace with Iran is the mother of all peace and war with Iran is the mother of all wars.’’

Trump responded with a tweet that warned: ‘‘NEVER EVER THREATEN THE UNITED STATES AGAIN OR YOU WILL SUFFER CONSEQUENCES THE LIKE OF WHICH FEW THROUGHOUT HISTORY HAVE EVER SUFFERED BEFORE.’’

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!

The agency, a government mouthpiece, also said Monday that Trump’s comment was only mimicking and copying Iranian Foreign Minister Mohammad Javad Zarif who had in the past warned the West to ‘‘never threaten an Iranian.’’

Trump earlier this year pulled the United States out of the international deal meant to prevent Tehran from developing a nuclear weapon and ordered increased American sanctions.

Rouhani had warned Trump Sunday to stop ‘‘playing with the lion’s tail’’ and threatening Iran, ‘‘or else you will regret it.’’

Trump has suggested Iranian leaders are ‘‘going to call me and say ‘let’s make a deal'’’ but Iran has rejected talks.

Rouhani has previously lashed out against Trump for threatening to re-impose the sanctions, as well as for moving the US embassy to Jerusalem and banning travel to the US from certain Muslim-majority countries.

Advertisement

Trump’s tweet suggested he has little patience with the trading of hostile messages with Iran, using exceptionally strong language and writing an all-capitalized tweet.

‘‘WE ARE NO LONGER A COUNTRY THAT WILL STAND FOR YOUR DEMENTED WORDS OF VIOLENCE & DEATH. BE CAUTIOUS!,’’ he wrote.

Trump has a history of firing off heated tweets that seem to quickly escalate long-standing disputes with leaders of nations at odds with the US.

In the case of North Korea, the public war of words cooled quickly and gradually led to the high-profile summit and denuclearization talks.

There has been little tangible progress in a global push to rid North Korea of its nuclear weapons program since the historic summit between Trump and North Korean leader Kim Jong Un on June 12.

Secretary of State Mike Pompeo flew to Pyongyang for follow-up talks earlier this month, but the two sides showed conflicting accounts of the talks. After his two-day visit, Pompeo said he had substantive discussions on next steps toward the North’s denuclearization, but the North’s Foreign Ministry accused the United States of making ‘‘gangster-like’’ demands for its unilateral disarmament.

Kim has made it clear that he wants a slow, step-by-step disarmament process in return for corresponding concessions and rewards from the United States on each of its denuclearization steps. Some experts say Kim is using diplomacy as a way to win outside concessions and weaken US-led international sanctions.

Advertisement

On Sunday in California, Pompeo was strongly critical of Iran.

He called the religious leaders of Iran ‘‘hypocritical holy men’’ who amassed vast sums of wealth while allowing their people to suffer, part of a highly critical broadside issued as the republic approached the 40th anniversary of its Islamic revolution and the US prepared to reimpose the economic sanctions.

Pompeo talked about increasing the media outreach to the Iranian people. He said the US Broadcasting Board of Governors is taking new steps to help Iranians get around internet censorship and is launching a new 24/7 Farsi-language channel across television, radio, digital, and social media formats, ‘‘so that ordinary Iranians inside Iran and around the globe can know America stands with them.’’

In the speech at the Ronald Reagan Presidential Library and Museum, Pompeo castigated Iran’s political, judicial, and military leaders, too, accusing several by name of participating in widespread corruption. He also said the government has ‘‘heartlessly repressed its own people’s human rights, dignity and fundamental freedoms.’’

He said despite poor treatment by their leaders, ‘‘the proud Iranian people are not staying silent about their government’s many abuses,’’ Pompeo said.

‘‘And the United States under President Trump will not stay silent either. In light of these protests and 40 years of regime tyranny, I have a message for the people of Iran: The United States hears you,’’ he said. ‘‘The United States supports you. The United States is with you.’’