President Trump fired a social media broadside at the Iranian regime Sunday afternoon, vowing that war between Washington and Tehran would result in "the official end of Iran" before warning, "[n]ever threaten the United States again!"

Trump tweeted hours after a rocket landed less than a mile from the U.S. Embassy in Baghdad's heavily fortified Green Zone, the first such attack since September. An Iraqi military spokesman told reporters the rocket appeared to have been fired from east Baghdad, which is home to several Iran-backed Shiite militias.

Tensions between the U.S. and Iran have risen in recent weeks after the Trump administration ordered warships and bombers to the Middle East earlier this month to counter threatened attacks against U.S. interests by Iran or Iranian-backed forces.

The U.S. also ordered nonessential staff out of its diplomatic posts in Iraq days after Secretary of State Mike Pompeo visited Baghdad told Iraqi intelligence that the United States had been picking up intelligence that Iran is threatening American interests in the Middle East. Two Iraqi officials told the Associated Press that Pompeo had offered no details of the alleged threat.

UK FOLLOWS US LEAD, RAISES THREAT LEVEL IN IRAQ DUE TO THREAT FROM IRAN

Trump appeared to have softened his tone in recent days, saying he expects Iran to seek negotiations with his administration. Asked on Thursday if the U.S. might be on a path to war with Iran, the president answered, "I hope not."

The U.S. Navy said Sunday it had conducted exercises in the Arabian Sea with the aircraft carrier strike group ordered to the region to counter the unspecified threat from Iran. The Navy said the exercises and training were conducted Friday and Saturday with the USS Abraham Lincoln aircraft carrier strike group in coordination with the U.S. Marine Corps, highlighting U.S. "lethality and agility to respond to threat," as well as to deter conflict and preserve U.S. strategic interests.

LARGE US WARSHIPS TRAIN TOGETHER IN ARABIAN SEA WITH EYE ON IRAN THREATS, NAVY SAYS

The USS Abraham Lincoln has yet to reach the Strait of Hormuz, the narrow mouth of the Persian Gulf through which a third of all oil traded at sea passes.

On the Iranian side, the head of the country's elite Revolutionary Guard, Gen. Hossein Salami, was quoted Sunday as saying Iran is not looking for war. But he said the U.S. is going to fail in the near future "because they are frustrated and hopeless" and are looking for a way out of the current escalation. His comments, given to other Guard commanders, were carried by Iran's semi-official Fars news agency.

Also Sunday, Saudi Arabia's minister of state for foreign affairs told reporters that the kingdom "does not want war in the region and does not strive for that ... but at the same time, if the other side chooses war, the kingdom will fight this with all force and determination and it will defend itself, its citizens and its interests."

Adel al-Jubeir spoke a week after four oil tankers— two of them Saudi— were targeted in an alleged act of sabotage off the coast of the United Arab Emirates and days after Iran-allied Yemeni rebels claimed a drone attack on a Saudi oil pipeline. The Saudis have blamed the pipeline attack on Iran, accusing Tehran of arming the rebel Houthis, with which a Saudi-led coalition has been at war in Yemen since 2015. Iran denies arming or training the rebels, who control much of northern Yemen, including the capital, Sanaa.

BRETT VELICOVICH: ATTACKS ON SAUDI OIL PIPELINES, TANKERS HAVE IRAN'S FINGERPRINTS ALL OVER THEM

"We want peace and stability in the region, but we won't stand with our hands bound as the Iranians continuously attack. Iran has to understand that," al-Jubeir said. "The ball is in Iran's court."

Saudi Arabia's King Salman, meanwhile, has called for a meeting of Arab heads of state on May 30 in Mecca to discuss the latest developments, including the oil pipeline attack. The state-run Saudi news agency reported Sunday that U.S. Secretary of State Mike Pompeo called Saudi Crown Prince Mohammed bin Salman to discuss regional developments. There was no immediate statement by the State Department about the call.

An English-language Saudi newspaper close to the palace recently published an editorial calling for surgical U.S. airstrikes in retaliation for Iran's alleged involvement in targeting Saudi Arabia's oil infrastructure.

CLICK HERE TO GET THE FOX NEWS APP

The current tensions are rooted in Trump's decision last year to withdraw the U.S. from the 2015 nuclear accord between Iran and world powers and impose wide-reaching sanctions, including on Iranian oil exports that are crucial to its economy.

Iran has said it would resume enriching uranium at higher levels if a new nuclear deal is not reached by July 7. That would potentially bring it closer to being able to develop a nuclear weapon, something Iran insists it has never sought.

The Associated Press contributed to this report.