Editor's Note: As the Islamic State is driven from Mosul, Iraqis and the the country's neighbors are wondering who will take the group's place. The Iraqi government is weak, and Iranian-backed Shi'a militias have proven a powerful force in the country. The good news is that they fight the Islamic State; the bad news is that they are often more loyal to Tehran than to the U.S.-backed government in Baghdad. Ariane Tabatabai of Georgetown examines the relationship between Iran and these groups, explaining Tehran's goals and the limits to its influence.

***

The battle against the Islamic State in Iraq and Syria (ISIS) took a decisive turn this week when Iraqi special operations forces and infantry pushed to capture the city of Mosul from the group in the largest operation in Iraq since the 2003 US invasion. This offensive was the final stage of a two-week long, complex series of operations to retake what was once Iraq’s second largest city and an ISIS stronghold since summer 2014. But it reached a new operational and political level, when the Shia militias joined the fight last weekend. And with the militias joining the battle, all eyes turned to their main sponsor: Tehran.

Iran sees Iraq as one of its two main spheres of influence and national security priorities, along with its eastern neighbor, Afghanistan. Iran shares a porous border and ethnic, religious, and economic ties with Iraq. Baghdad is responsible for causing the most damage to Iran in its modern history during a disastrous eight-year war in the 1980s. Today, Tehran sees the instability and insecurity of its western neighbor and ISIS’ presence there as one of the most pressing threats to its national security. As a result, it has allocated substantial resources to stabilizing Iraq and countering ISIS, making sure the group doesn’t use its territories in Iraq to successfully penetrate Iran. Since last summer, Iran’s Ministry of Intelligence and Security has unveiled several ISIS plans for attacks on its soil, fueling Tehran’s threat perception. Reports indicating a growing ISIS presence in Afghanistan further determine Iran to do everything in its power to push the group away from its borders to avoid being sandwiched between ISIS-controlled areas in Afghanistan and Iraq.

But Iran’s goals in Iraq are at times at odds with one another. For example, Tehran wants to stabilize Iraq and weaken ISIS, but it also wants to contain ISIS there. Iran sees deterrence—using its presence on the ground and its ties to local players to signal its ability and determination to push ISIS away from its territory—as vital to its counterterrorism operations and power projection in the region. But this strategy has helped forge its image as a sectarian player, something Tehran wants to avoid. Iran also wants to strengthen central authority in Iraq, but only to a degree. It wants Baghdad to be strong enough to stabilize the country, but not strong enough to become a threat to Iran again. And Tehran wants to maintain its presence and influence in Iraq, while also propping up groups, like the Shia militias, who do not always respond to its wishes and who challenge and undermine the development of central authority.

Among these groups, the Shia militias stand out due to the complexity of their controversial nature and the complexity of their relationship with Iran. These militias are composed of various groups with their own interests, agendas, and tools. They are often grouped under the umbrella, Hashd al-Shaabi—known in English as the Popular Mobilization Forces (PMF)—but not all PMF are created equal. Some are embedded in the Iraqi political system; others have allegiances to specific religious figures. And depending on their status within Iraq, they have various degrees of loyalty and dependence vis-à-vis Iran. In fact, some of these groups are fairly independent from Tehran and only receive some support, while others were actually created by the Islamic Republic. Virtually all seem to receive some degree of material support, such as financial aid, weapons, and equipment.

[T]he PMF present both an opportunity and an impediment for Iran.

The PMF’s main interlocutor in Iran is the Revolutionary Guards’ special forces, the Quds Force, which operates under the supervision of the notorious commander, General Qassem Soleimani. Soleimani’s presence and influence in Iraq isn’t a secret. He has deep ties to various factions, groups, and figures within Iraq and has positioned himself as an arbitrator and facilitator. He’s also the main architect and face of Iran’s counter-ISIS strategy. His forces widely use social media to circulate images of him in various Iraqi and Syrian towns and villages, engaging the local forces. This has established his image as the mysterious and influential commander, who’s on the ground and “plugged in.” This signals confidence and control to Iranian domestic constituencies, local forces who work with the Guards, ISIS, and adversaries in the region, including places such as Saudi Arabia. Despite often being referred to as Iran’s “shadow commander,” Soleimani’s visibility and fame are unusual for Iran’s military and paramilitary commanders. His charisma, ability to navigate the complexities of Iraq and Syria, and ties to a number of key political, military, insurgent, and religious individuals and groups, including the PMF, have positioned him as a fantastic asset for Tehran in Iraq.

But the PMF present both an opportunity and an impediment for Iran. On the one hand, their tactical prowess and skill—they often succeed where the Iraqi Army fails—are useful for Iran. They are able to mobilize quickly and in large numbers (15,000 alone are said to have joined the battle of Mosul). And, along with the Kurdish Peshmerga, they are on the ground, able to capture territory and neutralize ISIS fighters. On the other hand, the militias have close enough ties to Tehran to be a liability, but not close enough to be under direct Iranian control. As a result, the Islamic Republic’s ability to influence their decision-making and actions is limited, but some actions, including accusations of abusing Sunni Arab civilians, can exacerbate a delicate situation and end up reflecting poorly on Iran.

And problems stemming from the militias’ actions are many. The PMF have an openly sectarian agenda and approach, which further exacerbates the tensions within Iraq. They have reportedly committed their own share of systemic international humanitarian law and human rights law abuses. For example, they have retaliated against Sunni populations after capturing villages and towns from ISIS, by destroying buildings and abducting people, including in Fallujah earlier this year. And they don’t hesitate to use Iranian revolutionary imagery, including portraits of the Islamic Republic’s founder, Ayatollah Khomeini, and Supreme Leader Ayatollah Khamenei. As a result, Iran looks like it is openly propping Shia groups to fight not just ISIS, but Iraqi Sunnis more generally.

But that’s not the image Tehran wants to convey. To avoid looking like a sectarian actor, Iran has tried to work with Sunni groups. This has proven difficult for the Islamic Republic, though, as few Sunni Arabs are willing to cooperate with an actor they perceive as inherently sectarian. Soleimani himself has been careful to pose with Sunnis and Shias alike. His efforts to curate the image of a non-sectarian actor are in line with the views expressed by the man Soleimani directly reports to: Supreme Leader Ayatollah Khamenei. Like many within Iran’s political establishment, including President Hassan Rouhani, Khamenei is aware that sectarianism isn’t a winning tool for his country. And he has tried to address this (albeit to no avail) by calling on all Muslims in his country and elsewhere, Sunni and Shia, to come together and disavow differences. But the PMF’s actions is Iraq don’t help Iran’s credibility.

The Shia militias are close enough to Tehran for their actions to reflect poorly on Iran, but they’re not close enough to Tehran for it to actually be able to influence their decisions.

This is because, regardless of the complexities of Iran-PMF relations, many Iraqis, and Sunnis in general, view Shia militias as Iran’s arm in Iraq. And while the Guards and Iran’s political establishment go out of their way to tell the world that their policies aren’t sectarian, they aren’t doing anything to change the perception that they sanction the Shia militias’ actions, including war crimes.

For now, Tehran believes that the PMF’s benefits outweigh the costs of this relationship. The militias are a key local force in the fight against ISIS and have ties to Baghdad, which affords Tehran some level of legitimacy and an effective presence on the ground. By leveraging them, Iran can keep pushing back ISIS, ensuring the group doesn’t present a direct threat to its own territory and population while minimizing its direct involvement and boots on the ground. This decreases the costs of Iranian presence in Iraq.

But as ISIS is weakened and various players within Iraq begin to turn their focus from counterterrorism and counterinsurgency efforts to thinking about what’s next for the country, the Shia militias may increasingly become a liability for Tehran. The PMF are a useful tool for Tehran on a tactical level, but the Islamic Republic’s inability to fully control them can backfire. In particular, if the militias continue to commit war crimes with impunity and without a clear response from Tehran in Sunni-majority cities, like Mosul, as they did in other places after the fall of ISIS, Iran will have a much harder time positioning itself as an influencer in a post-ISIS Iraq.

The Shia militias are close enough to Tehran for their actions to reflect poorly on Iran, but they’re not close enough to Tehran for it to actually be able to influence their decisions. So far, from Iran’s perspective, the scale has tipped in favor of cooperation with these militias, as Tehran’s main focus has been to deter ISIS and prevent it from targeting its own territory and population. But this may change as the focus shifts from combatting insurgency and terrorism to addressing post-ISIS reconstruction and political challenges.