Over the last several months, Iranian-backed militias have repeatedly poked at the Americans in Iraq, firing rockets into the Green Zone that were apparently aimed at the United States Embassy. The militias have also hit several Iraqi bases where Americans were billeted, including in Gayara, just south of Mosul, and in western Iraq near Al Asad Air Base.
“I think Iran was reading that Trump really wants out of the region and is not willing to respond militarily,” Ms. Sky said. So the Iranians have been “trying to figure out how far they could go.”
Until Friday, the militias had never killed an American.
A senior administration official in Washington, speaking on condition of anonymity according to White House rules, said that the airstrikes were intended to restore deterrence. The official said that Iran’s policy has been to conduct deniable attacks, a fiction that the United States would no longer allow.
The Trump administration placed economic sanctions on three militia leaders this month, including the leader of Kataib Hezbollah. The United States accused those militias of participating in an unprovoked attack on anti-government protesters that killed 15 people.
The American strikes in Iraq hit near a town on the Syrian border. The strikes in Syria were in the country’s eastern desert, where Iran supports forces fighting on behalf of President Bashar al-Assad in Syria’s civil war.
Analysts said that the American message was clear, but that it may have been overshadowed by the high death toll.
“That puts the ball back in Iran’s court,” said Mr. Alaaldin of Brookings. “But make no mistake, that ball will, for now, be played in Iraq’s political arena, where the United States is much weaker. Iran has a strategic game plan on the ground in Iraq aimed at protecting and enhancing its influence in Iraq. The Americans do not.”
Farnaz Fassihi, Falih Hassan and Michael Crowley contributed reporting.