BAGHDAD/WASHINGTON (Reuters) - Iran promised vengeance after a U.S. air strike in Baghdad on Friday killed Qassem Soleimani, Tehran’s most prominent military commander and the architect of its growing influence in the Middle East.

Soleimani, a 62-year-old general who headed the overseas arm of the Revolutionary Guards, was regarded as the second most powerful figure after Supreme Leader Ayatollah Ali Khamenei.

The overnight attack, authorized by U.S. President Donald Trump, was a major escalation in a “shadow war” in the Middle East between Iran and the United States and American allies, principally Israel and Saudi Arabia.

A senior Trump administration official said the general had been planning imminent attacks on U.S. personnel across the Middle East. Democratic critics said the order by the Republican president was reckless and that he had raised the risk of more violence in a dangerous region.

“Soleimani was plotting imminent and sinister attacks on American diplomats and military personnel but we caught him in the act and terminated him,” Trump told reporters at his Mar-a-Lago resort in Florida. “We took action last night to stop a war. We did not take action to start a war.”

Trump said the United States was not seeking regime change in Iran, but that Tehran must end what he called its aggression in the region, including the use of proxy fighters.

A top U.S. general cautioned that the plot by Soleimani could still happen despite his death. U.S. officials said Washington was sending nearly 3,000 more troops to the Middle East, joining roughly 750 sent to Kuwait this week.

The attack, which also killed a top Iraqi militia commander and adviser to Soleimani, Abu Mahdi al-Muhandis, divided Iraqi opinion.

Many condemned the attacks, seeing Soleimani as a hero for his role in defeating the Islamic State militant group. Others voiced approval, saying Soleimani and Muhandis had backed the use of force against unarmed anti-government protesters last year and established militias that demonstrators blame for many of Iraq’s social and economic woes.

However, many Iraqis criticized Washington for killing the men on Iraqi soil and possibly plunging Iraq into another war.

Iraq’s Popular Mobilization Forces umbrella grouping of paramilitary groups said that early on Saturday in Baghdad, air strikes targeting its fighters hit a convoy carrying its medics near Taji stadium.

An Iraqi army source said six people were killed and three wounded. State TV reported that it was carried out by the United States. There was no immediate confirmation from Washington.

There had been a sharp increase in U.S.-Iranian hostilities last week when pro-Iranian militia attacked the U.S. Embassy in Baghdad following a deadly U.S. air raid on the Kataib Hezbollah militia, founded by Muhandis.

Iraqi Prime Minister Adel Abdul Mahdi said with Friday’s attack Washington had breached Iraq’s sovereignty and violated a deal for keeping U.S. troops there.

INTELLIGENCE OPERATION

Two Iraqi security sources said the attack followed an intelligence operation in which inside sources recruited by the CIA revealed the timing of Soleimani’s arrival in Baghdad and his convoy leaving the airport.

Khamenei said harsh revenge awaited the “criminals” who killed Soleimani and his death would redouble resistance against the United States and Israel. He called for three days of national mourning.

Foreign Minister Mohammad Javad Zarif said the attack was an act of “international terrorism” and Iran would take legal action to hold Washington to account.

U.S. officials said Soleimani was killed in a drone strike. Iran said he died in an attack by U.S. helicopters.

Israel put its army on high alert and U.S. allies in Europe including Britain, France and Germany voiced concerns.

U.S. Secretary of State Mike Pompeo said he was disappointed by the reaction of Washington’s European allies. “The Europeans haven’t been as helpful as I wish that they could be,” Pompeo told Fox News. “The Brits, the French, the Germans all need to understand that what we did, what the Americans did, saved lives in Europe as well,” he said.

Slideshow ( 30 images )

U.N. Secretary-General Antonio Guterres called for “maximum restraint.”

In a letter to Guterres and the U.N. Security Council, Iran said it reserved the right under international law to self-defense and that Soleimani’s killing “by any measure, is an obvious example of State terrorism.”

Iran’s top Arab foe, Saudi Arabia, urged restraint. Russian Foreign Minister Sergei Lavrov told Pompeo on a phone call that the killing “grossly violates international law” and would lead to serious consequences for regional peace and stability, according to a ministry statement.

The U.S. embassy in Baghdad urged American citizens to leave Iraq immediately, and dozens of U.S. citizens working for foreign oil companies in the southern city of Basra left. The evacuations would not affect output and exports, Iraqi officials said.

Oil prices jumped more than $3 a barrel over concern about disruption to Middle East supplies.

Slideshow ( 30 images )

‘STICK OF DYNAMITE’

The United States and its allies have suspended training of Iraqi forces due to the increased threat they face, the German military said in a letter seen by Reuters.

Chas Freeman, a retired U.S. diplomat who served as U.S. ambassador to Saudi Arabia, said he could think of no other example of the United States openly killing a senior foreign government official during peacetime. “This is unprecedented,” Freeman said.

Former Vice President Joe Biden, a top contender among Democrats seeking to run against Trump in the November presidential election, said Trump had “tossed a stick of dynamite into a tinderbox.”

After being briefed by U.S. officials in Washington, House of Representatives Intelligence Committee Chairman Adam Schiff, a Democrat, questioned why Trump chose to act against Soleimani now, when previous administrations decided such a step would increase the risks in the region.

“If the administration has a broader strategy, they have yet to articulate it,” Schiff told reporters.

As chief of the Quds Force, the Revolutionary Guards foreign arm, Soleimani had a main role in fighting in Syria and Iraq. Over two decades he was at the forefront of projecting Iran’s military influence across the Middle East and survived several assassination attempts by Western, Israeli and Arab agencies, acquiring celebrity status at home and abroad.

President Hassan Rouhani said the killing would stiffen Iran’s resistance to the United States.

In Tehran, the capital, hundreds of demonstrators marched toward Khamenei’s compound to convey their condolences.

“I am not a pro-regime person but I liked Soleimani. He was brave and he loved Iran, I am very sorry for our loss,” said housewife Mina Khosrozadeh in Tehran.

Soleimani became head of the Quds Force in 1998, after which he strengthened Iran’s ties with Hezbollah in Lebanon, Syria’s government and Shi’ite militia groups in Iraq.

In Soleimani’s home town, Kerman, people wearing black gathered in front of his father’s house, weeping as they listened to a recitation from the Koran.

“Heroes never die. It cannot be true. Qassem Soleimani will always be alive,” said Mohammad Reza Seraj, a teacher.