A growing protest movement, supported by the powerful cleric Muqtada al-Sadr and other elements of the Shia political and religious establishment, has demonstrated the potential limits of Iranian influence in the country. In doing so, it has opened the space for a reconfiguration of the regional dynamics shaping the country – just as a potentially post-ISIS future is in sight. But the question remains: once the unlikely coalition of anti-ISIS forces completes its objective of driving the militant group from its Iraqi capital of Mosul, who will fill the vacuum? Turkey and Saudi Arabia are increasingly working together to ensure that it is their allies rather than Iran’s that come out on top.

Erupting in the summer of 2015 in southern Shia-dominated cities such as Basra, Najaf and Karbala, the protests have focused on the continued failure of public services and frustration with the political stasis in Baghdad. While gaining the backing of Ayatollah Sistani, the highest Shia religious authority in Iraq, the movements has defied sectarian political divisions; attacking the domineering influence of the religious political establishment and its link to Iran.

Inevitably, the pro-Iranian elements of the political establishment have aggressively hit back. In particular, the former prime minister, Nouri al-Maliki of the ruling Islamic Dawa Party, has called for ending the protests with brute force. But the protesters have found more sympathy with current prime minister Haider al-Abadi, who, after initially being sceptical, has increasingly recognised the grievances of the movement and promised to carry out reforms.

As part of his proposals, al-Abadi has stressed the need for the federal government to enforce the rule of law across the whole country, putting him on a collision course with the so-called Popular Mobilisation Forces (PMFs), the largely Shia militias that were set up in response to the rise of ISIS.

For his part, al-Maliki has sought to undermine the al-Abadi government by supporting the continuation of the PMFs as an independent, quasi-state security apparatus. And he has been backed in this by Tehran, which hopes that the PMFs can be further drawn into its sphere of influence to become a powerful source of Iranian authority in Iraq, much like Hezbollah in Lebanon.

Into this growing political tension has stepped Saudi Arabia, whose foreign minister Adel al-Jubeir arrived for a historic visit to Baghdad on February 25. This unannounced move was surprising given the ongoing tension between Baghdad and Riyadh over Iranian influence in general and the role of the PMFs in particular.

Diplomatic relations between the two have previously been limited. Riyadh sent its first diplomatic delegate to Iraq only in December 2015, after roughly quarter a century of having no embassy in the country. And tensions rose again as early as March 2016, when the Saudi delegation withdrew from a meeting of Arab League Foreign Ministers after their Iraqi counterpart, Ibrahim al-Jaafari, rejected any condemnation of the PMFs as terrorist organizations.

Relations sank further last August, when Baghdad demanded that Riyadh change its ambassador,a staunch critic of the PMFs, accusing him of meddling with Iraqi internal matters. The Saudis complied with the Iraqi request after reports of a plot to assassinate the ambassador by one of the PMFs. The Iraqi government denied the claims, but the leader of Liwa Abu al-Fadhal al-Abbas (a significant PMF group) announced that killing the Saudi diplomat would be an “honor”.

This sudden Saudi rapprochement therefore seems to be an attempt to take advantage of the growing split in Iraq’s Shia-dominated political bloc, which has been brought to the fore by the protest movement and growing popular discontent. Riyadh wants to bolster the position of al-Abadi, who seems more willing to act in favour of limiting Iranian influence. This diplomatic move has been given further weight by a change of regime in America, with the Trump administration’s anti-Iran rhetoric now likely to put Baghdad under pressure to loosen links with Tehran.

Attention turns to Tal Afar

This diplomatic posturing is matched by developments on the battlefield, where the different actors involved in the fight against ISIS are positioning themselves to gain the most from the fall of Mosul. Some of the most extremist elements of the PMFs have set their eyes on the northwestern Iraqi city of Tal Afar.

This has caught the attention of Turkey, who has voiced concern for the Tal Afar’s large Sunni Turkmen population, who now dominate the city after it lost its Shia population (approximately one-third of its residents) when it was captured in the summer of 2014 by ISIS. But PMF plans to recapture the city has caught the attention of Turkey.

Much like it has done with Free Syrian Army forces in northern Syria through Operation Euphrates Shield, Turkey has trained a three thousand-strong Iraqi force named the Ninevah Guard, which is based in newly liberated parts of northern Mosul. After taking part in early waves of the assault on the city, the Ninevah Guard was formally excluded from the battle in October 2016 after Baghdad issued a warrant for the arrest of the militia’s leader, Atheel al-Nujaifi, who was accused of collaborating with a foreign country, based on claims that his forces allowed the entrance of Turkish troops and artillery into their base at Zlekan in northern Mosul.

The Ninevah Guard is predominantly drawn from the Sunni population around Tal Afar and is extremely hostile to the idea of a PMF takeover post-ISIS. In this, they are backed by Turkey, which has sent troops to the town of Silopi on its Iraqi border. President Erdoğan has stated that Ankara will intervene if necessary against any sectarian reprisals by the PMFs against the residents of Tal Afar. And reports indicate that Turkey has reinforced its military presence along the Iraqi border over the last few months.

Concerns regarding Iran’s growing influence over the future of both Iraq and Syria have driven Ankara and Riyadh to initiate security cooperation. On February 8, 2017 both countries’ defence ministers met to discuss developments in the region. This was followed by a February 13 visit to Saudi Arabia by President Erdoğan, who met with King Salman to further the two countries’ economic cooperation.

Moreover, earlier in February the “Strategic Cooperation Council”, created to bolster military, economic and investment cooperation between Turkey and Saudi Arabia, had its first session in Ankara, during which foreign ministers of both countries discussed possible areas of cooperation to leverage their influence in Iraq and Syria.

These developments would seem to represent the solidifying of the region’s divisions along sectarian lines. But more often than not, sectarian posturing is little more than the cover for geopolitical manoeuvring. Riyadh is hoping that by strengthening al-Abadi, it can decrease the chances of a possible military confrontation with Turkey over the role of the PMFs in Tal Afar, the ultimate result of which would likely embolden the pro-Iran factions in Baghdad.

For its part, Turkey’s attention to Tal Afar and the border area between Iraq and Syria grew only after the arrival of PMFs in the area. Indeed, Turkey did not come to the rescue of the Turkmen population during ISIS’ capture of the city in 2014. But the need to curb Iranian influence has become more urgent after the defeat of the proxies of Saudi Arabia and Turkey in Aleppo. Thus, while the battle to defeat ISIS is not yet over, the struggle over a post-ISIS Iraq has already begun.