TEHRAN, Iran — Iran struck back at the United States early Wednesday for killing a top Revolutionary Guards commander, firing a series of ballistic missiles at two military bases in Iraq housing American troops in a major escalation between the two longtime foes.

Iranian state TV said it was in revenge for the U.S. killing of Revolutionary Guard Gen. Qassem Soleimani, whose death last week in an American drone strike near Baghdad prompted angry calls to avenge his slaying. A U.S. official said there were no immediate reports of American casualties, though buildings were still being searched.

The strikes, which came as Iran buried Soleimani, raised fears that the two longtime foes were closer to war. But there were some indications that there would not be further retaliation on either side, at least in the short term.

Read: Oil prices pare gains, U.S. stock futures stem steep losses after Iran missile attack

“All is well!’ President Donald Trump tweeted shortly after the missile attacks, adding, “So far, so good” regarding casualties. Moments earlier, Iran’s foreign minister tweeted that Tehran had taken “& concluded proportionate measures in self-defense,” adding that Tehran did “not seek escalation” but would defend itself against further aggression.

Soleimani’s killing and the strikes by Iran came as tensions have been rising steadily across the Mideast after Trump’s decision to unilaterally withdraw America from Tehran’s nuclear deal with world powers. They also marked the first time in recent years that Washington and Tehran have attacked each other directly rather than through proxies in the region. It raised the chances of open conflict erupting between the two enemies, who have been at odds since Iran’s 1979 Islamic Revolution and the subsequent U.S. Embassy takeover and hostage crisis.

Iran initially announced only one strike, but U.S. officials confirmed both. U.S. defense officials were at the White House, likely to discuss options with Trump, who launched the attack on Soleimani while facing an upcoming impeachment trial in the Senate,

Iran’s Revolutionary Guard warned the U.S. and its regional allies against retaliating over the missile attack against the Ain al-Asad air base in Iraq’s western Anbar province. The Guard issued the warning via a statement carried by Iran’s state-run IRNA news agency.

“We are warning all American allies, who gave their bases to its terrorist army, that any territory that is the starting point of aggressive acts against Iran will be targeted,” the Guard said. It also threatened Israel.

After the strikes, a former Iranian nuclear negotiator posted a picture of the Islamic Republic’s flag on Twitter, appearing to mimic Trump who posted an American flag following the killing of Soleimani and others Friday.

Ain al-Asad air base was first used by American forces after the 2003 U.S.-led invasion that toppled dictator Saddam Hussein, and later saw American troops stationed there amid the fight against the Islamic State group in Iraq and Syria. It houses about 1,500 U.S. and coalition forces.

Two Iraqi security officials said at least one of the missiles appeared to have struck a plane at the base, igniting a fire. It was not immediately clear whether it was an Iraqi or U.S. jet. There were no immediate reports of casualties from the attacks, according to the officials, who spoke on condition of anonymity as they had no permission to brief journalists.

About 70 Norwegian troops also were on the air base but no injuries were reported, Brynjar Stordal, a spokesperson for the Norwegian Armed Forces told The Associated Press.

Trump visited the sprawling Ain al-Asad air base, about 100 miles or 60 kilometers west of Baghdad, in December 2018, making his first presidential visit to troops in the region. He did not meet with any Iraqi officials at the time, and his visit inflamed sensitivities about the continued presence of U.S. forces in Iraq. Vice President Mike Pence also has visited the base.

Iranian state TV said the Guard’s aerospace division that controls Iran’s missile program launched the attack, which it said was part of an operation dubbed “Martyr Soleimani.” Iran said it would release more information later.

The U.S. also acknowledged another missile attack targeting a base in Irbil in Iraq’s semiautonomous Kurdish region.

“As we evaluate the situation and our response, we will take all necessary measures to protect and defend U.S. personnel, partners and allies in the region,” said Jonathan Hoffman, an assistant to the U.S. defense secretary.

Wednesday’s revenge attack happened a mere few hours after crowds in Iran mourned Soleimani at his funeral. It also came the U.S. continued to reinforce its own positions in the region and warned of an unspecified threat to shipping from Iran in the region’s waterways, crucial routes for global energy supplies. U.S. embassies and consulates from Asia to Africa and Europe issued security alerts for Americans. The FAA also warned of a “potential for miscalculation or mis-identification” for civilian aircraft in the Persian Gulf amid in an emergency flight restriction.

A stampede broke out Tuesday at Soleimani’s funeral, and at least 56 people were killed and more than 200 were injured as thousands thronged the procession, Iranian news reports said. Shortly after Iran’s revenge missile attack early Wednesday, Soleimani’s shroud-wrapped remains were lowered into the ground as mourners wailed at the grave site.

Soleimani’s slaying already has led Tehran to abandon the remaining limits of its 2015 nuclear deal with world powers as his successor and others vow to take revenge.

In Iraq, pro-Iranian factions in parliament have pushed to oust American troops from Iraqi soil following Soleimani’s killing. Germany and Canada announced plans to move some of their soldiers in Iraq to neighboring countries.

The FAA warning issued barred U.S. pilots and carriers from flying over areas of Iraqi, Iranian and some Persian Gulf airspace. The region is a major East-West travel hub and home to Emirates airline and Dubai International Airport, the world’s busiest for international travel. It earlier issued warnings after Iran shot down a U.S. military surveillance drone last year that saw airlines plan new routes to avoid the Strait of Hormuz, the narrow mouth of the Persian Gulf.

The U.S. Maritime Administration warned ships across the Mideast, citing the rising threats. “The Iranian response to this action, if any, is unknown, but there remains the possibility of Iranian action against U.S. maritime interests in the region,” it said.

Oil tankers were targeted in mine attacks last year that the U.S. blamed on Iran. Tehran denied responsibility, although it did seize oil tankers around the Strait of Hormuz, through which 20% of the world’s crude oil travels.

The U.S. Navy’s Bahrain-based 5th Fleet said it would work with shippers in the region to minimize any possible threat.

The 5th Fleet “has and will continue to provide advice to merchant shipping as appropriate regarding recommended security precautions in light of the heightened tensions and threats in the region,” 5th Fleet spokesman Cmdr. Joshua Frey told The Associated Press.

Iran’s parliament, meanwhile, has passed an urgent bill declaring the U.S. military’s command at the Pentagon and those acting on its behalf in Soleimani’s killing as “terrorists,” subject to Iranian sanctions. The measure appears to be in response to a decision by Trump in April to declare the Revolutionary Guard a “terrorist organization.”

The U.S. Defense Department used that terror designation to support the strike that killed Soleimani.