A senior Iraqi officer investigating the attack said that using coordinates for the flight path, he and his team had located the launchers. The use of mortars and the area from which they were fired, he said, led him to think that the attack could have been carried out by the Islamic State.

Still, the officer, who spoke on condition of anonymity because he is not allowed to speak to journalists, said the weapons were common enough that he could not rule out a Shiite militia faction close to Iran as being responsible.

During the height of Iraq’s civil strife, between roughly 2005 and 2009, both Al Qaeda in Iraq and anti-American Shiite armed groups lobbed mortars at the Green Zone in an effort to hit the American Embassy.

The prime minister’s statement, released within hours of the mortars landing in the embassy compound, appeared aimed at reassuring the Americans that the Iraqis were taking the attack seriously and would mount a vigorous response. The comments stand in stark contrast to the response both to the attack on a military base in Kirkuk, Iraq, at the end of December, which resulted in the death of an American contractor, and to the siege of the United States Embassy on Jan. 1.

In those cases the government said relatively little, especially after the Kirkuk attack.

By contrast, Mr. Abdul Mahdi used his statement on the mortar attack as a way to remind the public, which is divided about whether to have United States troops stay in the country, that using force now against the Americans would risk “dangerous consequences” that could damage Iraqi interests and “drag Iraq into a war.”

The strikes come less than a month after the attack in Kirkuk, which set off a series of retaliatory responses that pushed the United States and Iran to the brink of war. The Americans accused Kataib Hezbollah, an Iraqi militia with close links to Iran, of responsibility in the Kirkuk attack.