But the outrage from Iraqis across the political spectrum, as well as threats of retaliation, also underlined the United States' growing isolation in Iraq and called into question the continued viability of about 5000 American troops left in the country after fighting against Islamic State.
US officials said the strikes were intended to deter rocket attacks such as the one targeting a military base in Kirkuk on Friday that killed an American defence contractor and injured four US troops, the first US casualties in an intensifying series of assaults.
"This was a defensive action designed to protect American forces and American citizens in Iraq, and it was aimed also at deterring Iran," Secretary of State Mike Pompeo told Fox News. "This was an Iranian-backed rogue militia acting to deny the Iraqi people their basic sovereignty."
The Iranian Foreign Ministry condemned the actions as "a clear example of terrorism," and a top militia leader vowed retaliation against US forces in Iraq.
The air strikes raised the stakes in the region-wide confrontation between Tehran and Washington that began after the Trump administration withdrew from a 2015 nuclear agreement and launched its "maximum pressure" campaign of economic sanctions against Iran. The sanctions have devastated Iran's economy and led the government to start pulling back from its commitments under the deal.
Loading
The United States has responded by adding more sanctions, but the lack of a US military response apparently has given the rulers in Tehran more confidence to launch attacks targeting the United States and its allies - 11 in the past two months alone.
Two weeks ago, Pompeo warned Iran of a "decisive US response" if the regime or its militias harmed American troops or allies in the region.
US officials said on Monday, US time, that the policy of "strategic patience" had its limits.
"We very much hoped that Iran would not miscalculate and confuse our restraint for weakness," said Brian Hook, a special envoy for Iran. "But after so many attacks, it was important for the President to direct our armed forces to respond in a way that the Iranian regime will understand."
Loading
Hook said the mission was one of "restoring deterrence."
David Schenker, the assistant secretary of state in charge of the Middle East, pushed back on the notion that the United States had violated Iraq's sovereignty.
"If there was a violation of sovereignty, [it] occurred on Friday when Iranian-backed forces basically shot missiles, rockets at an Iraqi military base," he told reporters.
But Iraq is finding its position between Washington and Tehran increasingly uncomfortable. Acting prime minister Adel Abdul Mahdi warned that there would be "dangerous consequences" after Sunday's retaliatory air strikes.
Loading
The condemnation came from many factions, as Iran and its allies intensified calls for US troops to leave Iraq. Protesters waging a three-month-old campaign against the government burnt American flags and expressed solidarity with the victims of the strikes.
At an emergency session of the Iraqi National Security Council, ministers and security officials described what they called a "grave violation" of rules governing the presence of US troops in Iraq, according to a statement issued after the meeting. Iraq will revisit the status of US troops in the country, the statement said.
The militia's allies warned of retaliation.
"The blood of the martyrs and the wounded will not go in vain, and the response will be harsh for the American forces in Iraq," said Jamal Jaafar Ibrahimi, deputy head of the Popular Mobilisation Units, of which Kataib Hezbollah is a part. He is a powerful ally of Iran who is better known by his nom de guerre, Abu Mahdi al-Mohandis.
The sanctions are intended to force Iran to reopen negotiations on the nuclear deal, but they have prompted the country to embark on what it has described as a campaign of "maximum resistance." The campaign has embroiled international shipping in the Persian Gulf and, increasingly, US troops in Iraq.
The retaliatory strikes, the first time the United States has used military force against an Iran-linked target since the US troop withdrawal in 2011, were intended to send a signal to Iran that the United States will no longer stand by while its troops in Iraq face danger, officials said. The United States sent troops back to Iraq after 2014 to fight the Islamic State militant group, and about 5000 of them are based there.
But with both sides now having drawn blood, there is a risk that the US troops will either be drawn into an escalating tit-for-tat exchange of fire with Iran's proxies in Iraq or face increased pressure from Baghdad to pull out of the country altogether, said Renad Mansour, director of the Iraq Initiative at the London-based Chatham House think tank.
Whereas both Iran and the United States had seemed intent on avoiding escalation in the past, that no longer seems to be the case, Mansour said. "Does this mean a new norm in US-Iranian relations in Iraq, which is that they are both willing to destabilise a country they have spent many years trying to stabilise?" he asked.
Alternatively, he said, Iran and its allies are likely to step up pressure for the removal of US troops from Iraq. Although some Iraqis still want the troops to remain as a counterbalance to Iran, "it's going to become more difficult for Iraqis advocating an American presence to make their case," Mansour said.
The Iranian Foreign Ministry said the attacks showed that the United States was a source of conflict and tension in Iraq and would have to pull its forces out. "America must put an end to its occupying presence," Iranian government spokesman Abbas Mousavi said.
Iraq's political leaders, who have sought to balance alliances simultaneously with both Iran and the United States, also condemned the strikes.
The Washington Post