When Nouri al-Maliki met Hamid Karzai in New York in 2007, most of the discussion was an exchange of niceties, but there was one thing the former Afghan President said which caught the attention of many in the Iraqi delegation. ‘When the relationship between Iran and the US is good, the security situation improves, and when the relationship worsens, security deteriorates’. At that time, Iranian backed Shia groups were fighting US troops in Iraq, heavily undermining America’s efforts against Sunni jihadists, and Iraq was on fire. Today, the US is still engaged in fighting Sunni Jihadists in Iraq, but Shia militant groups have switched sides, and Iraq has consequently been saved from collapse.

The relationship between Iran and Iraqi Shia is complex. While Iran is the country with the biggest Shia population and hosts the shrine of a Shia Imam, Iraq hosts the shrines of six Imams, and despite decades of oppression, the Najaf religious establishment still significantly outweighs Iran’s Qum. Since the foundation of the Iraqi state, the relationship between the two countries grew into one of rivalry. This culminated in the eight year Iran Iraq war during which Najaf never issued a fatwa against fighting Shia Iranians, in contrast with the fatwa issued in 1965 against fighting (mainly Sunni) Iraqi Kurds. No wonder that shortly after that war, when Iraqi Shia revolted against Saddam’s regime in 1991, they didn’t seek help from Iran, but instead from the US. However, that help, which many Iraqis believe was promised, never materialised.

When the US invaded Iraq in 2003 to topple Saddam’s regime, the Shia reaction was much colder than many expected. The memories of the ‘1991 betrayal’ were engraved deeper than Americans and exiled Iraqis thought, and Iran was quick to exploit the situation. Finding itself sandwiched (east and west) between troops whose commander in chief describes Iran as part of an ‘axis of evil’, the Islamic Republic started supporting whoever undermined the rationale behind keeping those troops in its vicinity. In Iraq, this included a complex combination of supporting the Iraqi government, and also militant groups which often fought it, but always fought US troops. They played the game with exceptional skill, persistence and pragmatism, ending up as an indispensable player in the Iraqi game. A player whose services were in demand, not only by Shia and Kurds, but also by Sunnis and Americans. All government formation deals in Iraq since 2006 have involved a consensus between the Iraqi political bloc, the US, and Iran.

In the midst of all this, Iraq’s Sunni neighbours found themselves lagging behind. When they realised that, they used their historic relations with the US to push for a bigger (and often disproportionate) Sunni role. Frustrated by an inability to advance interests, those regional US allies often got their hands dirty with anti-Shia Iraq violence, something which further undermined the US position amongst the Shia, and obviously strengthened Iran’s. Arab Iraq was at that point, fully polarised along sectarian lines, with Iran often portraying itself as the Shia’s ‘only reliable ally’.

In 2011, US troops left Iraq, and Shia militant activity was suspended. Without the distraction of worrying about the future plans of a 150,000 US soldiers stationed next door, the Iranians focused on building further political influence in Iraq, gaining further ground. When something called the Arab Spring went wrong, giving way to an evolved version of Sunni Jihadism, Iranians were back to assisting Shia militant groups. However, this time, these groups, the Iraqi regular troops, and the Americans were fighting a single enemy, the so called Islamic State. The presence of both US and Iranian officers on Iraqi soil at the same time, highlighted once again Iraq’s conflicting alliances, and raised questions about consequences of Iraqi Shia over-reliance on Iran.

It is always tempting (and intellectually unchallenging) to mass brand Iraqi Shia politicians as natural proxies of Iran. While this is evidently not true, questions have to be asked about what happens after IS is defeated. A continuation of the current ‘dual alliance’ with both Iran and the US carries a risk of being locked in a long term conflict between two largely opposing powers. One of them is a regional giant, described by many in the world as a rogue state, and the other is an international superpower with a vested interest in Iraq, and a sense of responsibility towards it. As long as these two powers are strategic enemies of one another, their competition over influence in Iraq means instability for the foreseeable future.

A positive conclusion of the nuclear talks between Iran and the P5+1 will certainly reduce tensions, but it won’t spare Iraq, and its Shia in particular, the need to make a strategic choice between Iran, the US, or continued uncertainty. Reduced tension will give Iraq much greater leeway in managing external relations. Both Iran and the US will see steps away from them less threatening, but may at the same time expect Iraq to move closer rather than farther. The easiest choice will be a continuation of the current ‘neither here nor there’ position, but it is one which leaves Iraq most vulnerable for future fluctuations, because it blocks formation of subsequent alliances based on the position towards either Iran or America. We seem to be heading towards a strategically crucial turning point for Iraq, and it is certainly hoped that Iraqi leaders live up to the moment. Iraq needs to make foreign policy choices which ensure long term stability, prosperity, and democratic viability.