Iran's missile strike on US bases realises a long-held fear for Iraq: To become the battlefield for an open conflict between a deeply connected neighbour and the world's military superpower.
That now depends on the American response to Wednesday's assault, itself retaliation for the killing in Baghdad of Iran's top military commander by a US drone. Washington said there were no casualties and there were reports that Iran gave warning, so the US may choose not to escalate.
Yet the US-Iran contest in Iraq is not new and is likely to continue by other means. American troops and diplomats remain vulnerable to attack by multiple players. Iranian officials have pledged to continue their push to get the US out of Iraq, a fight that was being led by Qassem Soleimani before his death and will be taken up by his successor.
Iraq's caretaker prime minister, Adel Abdul Mahdi, was "making the necessary internal and external contacts in an attempt to contain the situation and not engage in open warfare," his spokesman said in a statement after the Iranian missile strikes on the American bases.
Iraq is still recovering from a decade of civil war. This week has plunged a nation already divided along sectarian and ethnic lines into a fierce dispute over whether to expel US forces from the country, 17 years after the invasion that toppled former dictator Saddam Hussein. The risk is that Iraq again becomes the regional tinderbox and could even raise the prospect of a resurgence for Daesh extremists.
The Jan. 2 hit on Soleimani also killed Iraqi militia leader Abu Mahdi al-Muhandis, who was part of the convoy. The pro-Iran Asaib Ahal Al-Haq militia promised retribution that would be no smaller than Iran's.
"Now is the time for the initial Iraqi response to the assassination of the martyr leader Muhandis," the office of the group's leader tweeted Wednesday morning.
The division between Shiites, many of whom feel an affinity to Iran, and the Sunni minority was evident on Sunday. Sunni Arab and Kurdish legislators boycotted a vote by Iraq's Shiite-dominated parliament to terminate invitations to host the US military.
It's a question with a long history. Haider al-Abadi, Iraq's prime Minister from 2014 to 2018, was continually having to balance the US and Iran, including during the fight to retake territory seized by Daesh.
"I was very frank with both of them to say 'look, I know you have your differences, but please keep them away from the country,'" he told an audience at the World Economic Forum in Switzerland shortly after announcing victory in that campaign. He also worried that with Daesh defeated, pressure on Iran and the US to cooperate in Iraq would lift.
More recently, anti-government protests in Baghdad's Tahrir Square and cities across the country have called for the end of Iranian as well as US influence. In a country with a growing sense of national identity, the protesters saw both powers as malign impediments to the ability of ordinary Iraqis to take back control over their own fate.
But with Shiite religious leaders arguing for Iran's case of revenge, those hopes for a more stable and independent Iraq focused on developing its economy appear to have been set back.
For Sunnis and Kurds, the US has acted as a guarantor not only against Iranian dominance in a fellow Shiite majority nation, but also against Deash resurgence. On Wednesday they pushed back against the rush to drive US forces out.
In its statement on Wednesday morning's attack, the regional government in Iraq's northern Kurdistan province called for calm and stressed the continued importance of "countering terrorism in the region and Iraq with the support of the international coalition." One of the two bases struck by Iranian missiles was near Erbil, the regional capital.
Iraqi Parliament Speaker Mohamed Al-Halbousi, a member of the legislature's Sunni bloc, on Wednesday sought to balance the two sides. He called on the government to preserve Iraqi sovereignty and rejected "the conflicting parties attempt to use the Iraqi arena to settle scores."
If the security situation deteriorates, divisions between Shiites, Sunni and Kurds over how to react could again split the country, according to Ihsan Al-Shammari, the director of Baghdad's Political Thought Center.
Iran may now take a step back from such overt action against US assets in Iraq, but it will continue attacks using its agents and allies within the country, said Al-Shammari. "Officially, with this latest targeting, Iraq has turned into a battlefield between Tehran and Washington," he said.