Tensions between Iran and the US are once again high after a series of American airstrikes on pro-Iranian militias in Iraq and Syria, which killed at least 25 fighters and wounded dozens of others.
This was followed by violent protests at the US embassy in Baghdad with protesters attempting to scale its walls, as Iraqi security forces stood aside.
Only loudspeaker announcements telling protesters that the ‘message was delivered’ drove the demonstrators away from the compound.
The US strikes that sparked the embassy protest followed a rocket attack on an American base near the northern Iraqi city of Kirkuk, in which a civilian contractor was killed.
While no group claimed responsibility for the attack, the US appears to be holding Tehran responsible by attacking the Iranian-trained and commanded, Kataeb Hezbollah militia.
The group’s weapons caches and command structures were hit in both Iraq and Syria, marking a rare direct breakout of hostilities between Iranian militias and the US.
While there is little but informed speculation to go on in determining Tehran’s intentions, the latest flare-up comes amid a severe internal unrest over the economy, and protests against Iranian hegemony in both Iraq and Lebanon - two states in which Iran has traditionally held strong sway.
Domestically, Iran is reeling from the re-imposition of sanctions after the US withdrawal from the Iran nuclear deal. Consequent austerity measures have led to a number of widespread anti-government protests that have reportedly led to the death of hundreds.
These have come coupled with similarly motivated protests in Iraq and Lebanon, with anger in both countries directed at Iran and its proxies.
In the Iraqi city of Najaf, a curfew was imposed after protesters set alight the Iranian consulate there.
In Lebanon, protesters have clashed with supporters of Iran’s most well known militia, Hezbollah.
Even heavyweights within Iraq’s Shia establishment, such as Ayatollah Sistani, have warned Iran against making Iraq the scene of a confrontation with the US.
As a result of these developments, Tehran has found itself on the backfoot and for the first time in years faces the prospect of reduced influence in the region.
The US logic in confronting Iran has up until now been to increase domestic opposition to Tehran through sanctions and to weaken the grip its proxies have in countries such as Iraq and Lebanon.
While this tactic has succeeded in creating difficulties for Iran, Tehran has its own cards to play.
US President Donald Trump has partially built his popularity on the promise of withdrawing his country’s military from foreign entanglements that his predecessors Barack Obama and George W Bush led Americans into.
To that end, he is looking to eventually withdraw American soldiers from the conflicts in Afghanistan, Iraq, and Syria.
Hit hard by impeachment, responding to Iran with military force gives Trump a momentary distraction but an escalation would see him dragged into a war that could alienate enough supporters to cost him the 2020 vote.
The burgeoning conflict has repercussions beyond Trump’s domestic ratings and could determine the fate of Iraq and the wider Middle East for decades to come.
As things stand on New Year’s eve, Baghdad is strongly allied to both Iran and the US. Any conflict between the latter two could push it into a Catch 22 position where it cannot abandon one or the other.
Both were pivotal allies in the war against Daesh. US airpower knocked out much of the terrorist group’s defence capability, allowing Iranian trained militias to go in and secure urban areas.
It is also the US-led coalition that has propped up the Iraqi government as a unified body with its continued military presence in the country.
The same can be said of Iran’s role in funding Iraq’s dominating Shia parties. They would not exist in their current form without Iranian backing.
A conflict, therefore poses an existential threat to the Iraqi government, the collapse of which neither Tehran or Washington can afford.
The fact that protesters have now withdrawn from the US embassy, suggests that they were never intending to attack it and were instead there to show the US the potential of the quagmire they can get into.
Nevertheless, with both Trump and the Iranian government trying to hold off pressure from domestic opponents, games of brinkmanship can easily turn into broader conflicts that neither side can afford.