BEIRUT — Iran vowed revenge on Friday in response to a U.S. airstrike that killed Tehran's most powerful military commander, sharpening tensions across the Middle East as the Trump administration said it was sending thousands of troops to bolster security in the region.

Maj. Gen. Qasem Soleimani was a towering figure as Iran projected power across the Middle East, with close links to a network of paramilitary groups stretching from Syria to Yemen. And his death in the smoldering wreckage of a convoy in the Iraqi capital, Baghdad, marked the most dramatic escalation in hostilities between the United States and Iran since President Trump withdrew from the landmark nuclear deal with Tehran in 2018 and reimposed sanctions.

The deadly U.S. drone strike left U.S. outposts and personnel bracing for retaliatory attacks Friday and sent oil prices shooting upward. The U.S. Embassy in Iraq told Americans to leave the country “immediately.”

Iran responded swiftly, promoting Soleimani’s deputy within hours of the commander’s death.

“His work and path will not cease, and severe revenge awaits those criminals who have tainted their filthy hands with his blood and the blood of the other martyrs,” Iran’s supreme leader, Ayatollah Ali Khamenei, said in a statement.

The country’s defense minister, Amir Hatami, said the nighttime strike ordered by Trump would be met with a “crushing” response. If Iran were to order a reprisal, experts said U.S. troops in Iraq, oil tankers or other American economic interests in the Persian Gulf would be the likely targets.

The Pentagon said it was preparing to deploy an additional 3,500 soldiers from the 82nd Airborne Division to the region. According to two defense officials, the military also has put hundreds of soldiers from the Army’s 173rd Airborne Brigade in Italy on alert for potential deployment.

Trump told reporters Friday that the United States had killed Soleimani in a bid to “stop a war.” The president, speaking at his Mar-a-Lago resort in Florida, urged Iran not to retaliate. “We did not take action to start a war,” he said.

The drone attack, which struck a two-car convoy on an access road near Baghdad International Airport and also killed several of Soleimani’s local allies, sent anxieties rippling across a region already roiled by rising tensions between Washington and Tehran.

Iraqi Prime Minister Adel Abdul Mahdi called the attack “an assassination” that was in “flagrant violation of the conditions authorizing the presence of U.S. troops” on Iraqi soil.

The country seemed to be holding its breath. Streets were quiet. Many restaurants were deserted. Along checkpoints down the streets, young soldiers and militiamen clutched their weapons tightly, appearing nervous at what might follow.

In Iran, Friday was a day of public mourning as tens of thousands of people took to the streets to decry the U.S. attack, even as many privately expressed worry about the escalating conflict with the United States.

While the killing of Soleimani came after a week of spiking tensions, including a siege of the U.S. Embassy in Baghdad by supporters of an Iranian-backed militia, the general had been one of the United States’ most daunting adversaries for two decades.

Soleimani joined Iran’s Islamic Revolutionary Guard Corps as a young man and took control of the Quds Force, its special operations wing, in the late 1990s. Under his command, the force built alliances across the region by paying for weapons and providing strategic guidance. Soleimani was regularly photographed on visits to affiliated militias in Iraq, Syria and elsewhere, burnishing an reputation as a talismanic operator with influence across the Middle East.

Iranian state media said he would be succeeded by his deputy, Brig. Gen. Ismail Qaani. Khamenei said strategy would remain “identical.”

The U.S. strike appeared to have killed some of the Quds Forces’ key allies. Among the dead were Jamal Jaafar Ibrahimi, a powerful Iraqi militia leader better known by his nom de guerre, Abu Mahdi al-Muhandis, who was once imprisoned in Kuwait for bombing the U.S. Embassy there.

U.S. Secretary of State Mike Pompeo said the attack was spurred by intelligence indicating that Soleimani was overseeing an “imminent” attack on American citizens in the Middle East.

“The American people should know that President Trump’s decision to remove Qasem Soleimani from the battlefield saved American lives,” Pompeo told Fox News. “He was actively plotting in the region to take actions, a big action as he described it, that would have put dozens, if not hundreds, of American lives at risk.”

Pompeo offered no public evidence to support his statements. They followed comments Thursday by Defense Secretary Mark T. Esper suggesting that Iran and its local allies may be preparing renewed strikes on U.S. personnel in Iraq.

The targeted killing set off a sharp political debate in the midst of the American presidential campaign.

As Republicans celebrated what they described as Trump’s decisive action, Democrats criticized the president’s order to act unilaterally while expressing grave concern that the action would move the United States closer to an in­trac­table war with Iran.

“This morning, Iran’s master terrorist is dead,” Senate Majority Leader Mitch McConnell (R-Ky.) said in remarks on the Senate floor. “The architect and chief engineer for the world’s most active state sponsor of terrorism has been removed from the battlefield at the hand of the United States military.”

But across the aisle, Sen. Chris Murphy (D-Conn.) predicted that Soleimani could become more dangerous to the U.S. in death “as a martyr than as a living, breathing military adversary.”

“There will be reprisals,” he said. “This is why the United States does not assassinate leaders of foreign nations — in the end such action risks getting more, not less, Americans killed in the long run,” he said.

Presidents typically inform the so-called Gang of Eight — the House speaker and minority leader, the Senate majority and minority leaders, and the chairmen and ranking minority members of the House and Senate intelligence committees — on high-level military operations.

Top Democratic leaders in Congress received no advance notification of the strike, according to aides. Speaking on the Senate floor, Minority Leader Charles E. Schumer said the administration must be “asked probing questions not from your inner and often insulated circle, but from others, particularly Congress, which forces an administration before it acts to answer very serious questions.”

Experts warned Friday that the strike could be a catalyst for greater violence.

“We have to expect some escalation in the form of retaliation on the Iranian side,” said Riad Kahwaji, founder of the Dubai-based Institute for Near East and Gulf Military Analysis.

He predicted that the Iranians would seek to assassinate or kidnap senior Americans in the region or strike U.S. naval targets in the Persian Gulf. That could in turn prompt a further U.S. escalation, perhaps to include strikes on Iranian territory.

As Friday wore on, the responses from Iran’s paramilitary allies rolled in. In Lebanon, Hezbollah leader Hasan Nasrallah issued condolences for Soleimani’s “martyrdom” and urged Shiite militia factions in Iraq not to let his death “go to waste.”

Moqtada al-Sadr, a prominent Iraqi Shiite cleric and militia leader, used his Twitter account to order fighters from his Mahdi Army “to be ready.” Formed in the aftermath of the 2003 U.S.-led invasion of Iraq, the group gained notoriety for its attacks on U.S. troops.

Friday’s drone attack raises fresh questions about Trump’s approach to the Middle East. While the president has employed bellicose rhetoric and authorized several strikes against the military of Syrian President Bashar al-Assad — a close Iranian ally — Trump has repeatedly promised to get the United States out of costly wars in the region.

In Iraq on Friday, families woke early and stayed home, glued to social media or satellite television channels where commentators turned over questions about what might happen next. When asked how they felt, some referenced the feeling of calm before the storm ahead of the 2003 U.S.-led invasion of Iraq.

Mustafa Salim in Baghdad, Liz Sly and Sarah Dadouch in Beirut, Erin Cunningham in Istanbul and Dan Lamothe in Washington contributed to this report.