WASHINGTON (NYTIMES) - For months, furious protests have battered Iraq, driven by frustration at a dysfunctional economy, corruption and the pervasive influence of a foreign power: Iran.
Then a rocket attack killed an American contractor in Iraq, American airstrikes hit an Iranian-backed Iraqi militia, and Iraqis' anger turned back on the United States, culminating with a break-in at its embassy compound in Baghdad on Tuesday (Dec 31).
The airstrikes and the embassy stand-off, with demonstrators drawn largely from Iranian-backed militias, brought the US to its most serious crisis in the country in years - and pulled it deeper into the volatile problems engulfing Iraq and its neighbour Iran.
Complicated at the best of times, the relations between Iraq, Iran and the US are now even more fraught.
WHAT HAPPENED IN THE LAST FEW DAYS?
Last Friday, more than 30 rockets were fired at an Iraqi military base near Kirkuk, in northern Iraq, killing an American civilian contractor and wounding four American and two Iraqi servicemen.
The US accused an Iranian-backed militia, Kataib Hezbollah, of carrying out the attack. A spokesman for the militia denied its involvement. President Donald Trump blamed Iran for the attack, writing on Twitter on Tuesday: "Iran killed an American contractor, wounding many."
The American military launched airstrikes against the militia over the weekend, killing 24 members in what Secretary of State Mike Pompeo called "a decisive response". He said the US would "not stand for the Islamic Republic of Iran to take actions that put American men and women in jeopardy".
The US and Iran are at longstanding odds - over influence in Iraq, Iran's nuclear programme and other issues - and tensions have spiked under the Trump administration, which pulled out of the 2015 nuclear accord and imposed punishing sanctions on Teheran.
But the American airstrikes came at a particularly combustible moment in Iraq, where anger at foreign meddling was already running high. For much of the last 16 years, Iraqis' ire has been directed at the US for its invasion and the war and occupation that followed. Iran has also deeply embedded in Iraq, raising fears that the country would be caught in the rivalry between Teheran and Washington.
The country's top Shi'ite cleric, Grand Ayatollah Ali al-Husseini al-Sistani, warned that Iraq must not become "a field for settling regional and international scores", and Prime Minister Adel Abdul-Mahdi called the airstrikes a violation of Iraqi sovereignty.
On Tuesday, protesters stormed the sprawling US Embassy compound in Baghdad. They did not enter the main embassy buildings, and eventually joined thousands of others nearby - many of them members of the fighting groups technically overseen by the Iraqi military, and many chanting "Death to America".
Mr Trump accused Iran of "orchestrating" the break-in, adding that "they will be held fully responsible". Many of the protesters who broke into the compound were members of Kataib Hezbollah and other Iranian-backed militias.
On Wednesday, militia leaders ordered their supporters to stand down, and most of the people outside the compound withdrew.
WHY HAS IRAQ BEEN SO VOLATILE RECENTLY?
Huge, sometimes violent protests began erupting across Iraq in October, as people angry about unemployment, corruption and shambolic public services poured into the streets. For 12 weeks, the government flailed for a solution, variously promising reform and cracking down.
More than 500 people were killed and 19,000 injured in the unrest, according to the UN special envoy to Iraq.
The brutal government response hardened protesters' resolve, and the protests gradually expanded to include complaints about Iran's widespread influence in Iraq's government. (An Iranian general, Maj Gen Qasem Soleimani, had brokered the deal creating the current government.) Many protesters link Iranian influence to corruption in the government and among Shi'ite militias.
In November, protesters burned down the Iranian Consulate in the southern city of Najaf, and for weeks, protesters camped outside the heavily guarded Green Zone of Baghdad, the seat of Parliament and the prime minister. By the end of the month, Mr Abdul-Mahdi said he would resign.
Iraq's government has been in limbo ever since, unable to pick his successor.
HOW IS IRAN INVOLVED IN IRAQ'S MILITIAS?
After years of competing with the US for influence over Iraq, Iran has emerged as an aggressive and powerful force in Iraqi life.
Iran wields powerful influence in the government, business and religion. Iranian-linked parties have gained significant strength in Parliament, especially since the American military withdrawal in 2009. And when the Islamic State invaded Iraq in 2014, Iran helped form Shi'ite militias to fight it, giving it leverage in Iraq's security.
As the militias and the US - effectively fighting on the same side - drove the Islamic State out of territory it controlled in Iraq, the militias gained influence. They control powerful factions in Parliament and the military, and some have turned into mafia-like groups that use extortion rackets to profit from Iraqis.
Some militias have attacked Iraqi bases where Americans are stationed, too. The populist cleric Muqtada al-Sadr, who has called for the US and Iran to leave Iraq, urged the militias to stop "irresponsible actions".
The group accused in last Friday's rocket attack, Kataib Hezbollah, has close ties to Iran, but many Iraqis consider it a primarily Iraqi force. It is separate from the Hezbollah movement in Lebanon, though both groups have Iran's backing and oppose the US. The US State Department has designated both groups as terrorist organisations.
Kataib Hezbollah promised "retaliation" for the airstrikes, without providing details. Iran's Foreign Ministry said the US "must accept full responsibility for the consequences of this illegal action".
WHAT IS THE UNITED STATES PRESENCE IN IRAQ?
The US has about 5,200 troops in Iraq, and a fluctuating number of civilian contractors. Most of the soldiers are stationed at a base north-west of Baghdad and at a base in the Kurdish-controlled north.
The embassy compound in Baghdad opened in 2009 and, at 104 acres, is nearly as large as Vatican City. The compound and the American Consulate in Irbil, in northern Iraq, have a combined staff of 486, most in Baghdad.
After the storming on Tuesday, the Pentagon sent 120 additional Marines to Baghdad. Late on Tuesday, Secretary of Defence Mark Esper announced that about 750 troops would deploy to the region.
The American presence in Iraq has declined sharply from its height during and immediately after the Iraq War. There were nearly 16,000 people in the embassy compound in 2012, and 170,000 troops in Iraq in 2007. Amid rising tensions with Iran this year, the State Department ordered some diplomats to leave the embassy.
WHAT'S HAPPENING IN IRAN?
Adding to the regional turmoil, Iran has also been reckoning with its worst unrest in decades.
These protests began in November with a sudden increase in gasoline prices, and grew into demonstrations against Iran's leaders and how they have handled American sanctions, a staggering economy and anger from neighbours in Iraq and Lebanon.
Thousands of people demonstrated, many from cities with large low-income and working-class populations, but Iran's security forces crushed the protest, killing up to 450 people, according to human rights groups.
Iran's supreme leader, Ayatollah Ali Khamenei, justified the crackdown by calling the protests a plot by Iran's enemies at home and abroad.