Donald Trump threatened to bring about the “official end of Iran” if leaders in Tehran continue to threaten the U.S. And, in typical Trump fashion, he did it on Twitter.

“If Iran wants to fight, that will be the official end of Iran. Never threaten the United States again,” Trump warned Sunday in a tweet storm that came out of the blue after days of attempts to defuse rising tensions between the countries.

On Wednesday, Trump appeared to be trying to ease tensions with Tehran, saying he was “sure that Iran will want to talk soon.”

Trump’s threat may have been a reaction to Sunday’s rocket attack on Baghdad’s Green Zone, the heavily-fortified neighborhood that houses the world’s largest U.S. embassy by size. The rocket landed near the U.S. embassy, but Iraqi military said there were no casualties. The attack came days after the U.S. evacuated non-emergency staff from its embassies in Iraq.

No one has claimed responsibility, but an Iraqi military spokesman told the Associated Press that the rocket was believed to have been fired from east Baghdad, which is home to Iran-backed Shiite militias.

“[The U.S.] will hold Iran responsible if any such attacks are conducted by its proxy militia forces or elements of such forces, and will respond to Iran accordingly,” a U.S. State Department official said.

Some observers, however, suggested Trump wasn't reacting to the rocket attack but to a Fox News segment on the threat posed by Iran:

Officials within the Trump administration have cited intelligence about a heightened threat from Iran and its proxies in the region for withdrawing embassy staff and for sending warships and B-52 bombers to the region. But the White House is sharply divided about how to interpret the information, and some officials claim the intel was misinterpreted.

Iran blames Washington for escalating tensions between the two countries, describing the U.S.’s actions as “psychological warfare” and a “political game.”

Tehran has yet to respond directly to Trump’s latest threat, but it indicated over the weekend that it has no desire to engage in an all-out war with the U.S.

"There will be no war because neither we want a war nor has anyone the idea or illusion that it can confront Iran in the region," Iran’s foreign minister Mohammad Javad Zarif said Saturday.

U.S. ally Saudi Arabia, which last week blamed Tehran for drone strikes on two oil pumping stations, also said it didn’t want war. But the kingdom’s Minister of State for Foreign Affairs Adel al-Jubeir warned that it would respond with “all strength and determination” to any threat made against it.

In a bid to resolve regional tensions, King Salman invited Gulf leaders and Arab League member states to two emergency summits in Mecca on 30 May to discuss recent “aggressions and their consequences.”