On June 26, the Iraqi government declared Fallujah, a city just west of Baghdad, fully liberated after more than two years of Islamic State (ISIS) control. The Iraqi army played a key role in the effort, but it could not have won without the Popular Mobilization Forces (an umbrella of Iraqi militiamen who are mainly Shia but who now also include some Sunnis) and airstrikes by the U.S.-led coalition. The Iraqi government has been unwilling to acknowledge its dependencies, however, and has portrayed the PMF as a mere sidekick to the national army even though many of the groups fighting under the PMF banner operate independently. Such groups do not report to the Iraqi government and some of them have other patrons, including Iran.

However slanted, Baghdad’s characterization of the PMF helps it legitimize their partnership by elevating their status from militias to government aides and it also makes the weak national army and government appear stronger. But the tactic is dangerous and it could backfire. Iraq is essentially outsourcing the fight against ISIS to militias backed by Iran, which could weaken state legitimacy and sovereignty in the long run.

This dynamic is also present in Syria. The Iraqi army began to decline after the 2003 U.S. invasion. The chaotic aftermath of the war led to a decade of mismanagement by the government and its international backers. Across the border in Syria, meanwhile, both rebels and extremist groups have ground down the defenses of President Bashar al-Assad. In turn, Iraq and Syria’s armies have had to rely on other forces to fight their opponents. In 2012, the Syrian state partnered with Iran to create the National Defense Forces, regime loyalists whom Assad depicted as patriotic fighters volunteering to support the state against “terrorism”—which for the regime is a broad term that includes ISIS and rebels alike. Syria later added to the mix the Russian-backed Syrian Democratic Forces, a primarily Kurdish militia that battles ISIS in the country’s northern and eastern regions.

A PMF member stands beside a wall painted with the Islamic State flag, Iraq, March 10, 2015. Thaier Al-Sudani / Reuters

Assad’s use of non-governmental militias is not just about fighting ISIS. It is also about rebranding. The Syrian regime seeks to portray the state’s suppression of what began as an uprising as a popular effort to eradicate terrorism. The militias, made up of a diverse swath of Syrians, helps to strengthen, and in some ways legitimize, that narrative: Syrians are together protecting their nation from traitors and militants.

Iraq, although it operates in a different context from Syria since the former has an internationally recognized government, is also using the militias to bolster popular support, especially as it faces increasing pressure from opposition actors such as the Sadrist movement led by the cleric Muqtada al-Sadr. The inclusion of Sunnis and other ethnic communities in the PMF has allowed the Iraqi government to frame the fight against ISIS, which professes to follow an extreme Sunni-based version of Islam, as a non-sectarian one. Many within the Sunni community have even praised the PMF, calling it a citizen-led movement in aid of the state.

However, in both Iraq and Syria, the militias can be unruly. Syria’s National Defense Forces have been known to attack even pro-regime civilians while some Kurdish members of the Syrian Democratic Forces have even tried kill off or push out the Arabs in Tal Abyad in north eastern Syria when they ousted ISIS there in the summer of 2015. Some Shia groups within the Iraqi PMF have attacked Sunni civilians. This behavior will only create grievances against the state and further sectarian division, which could eventually weaken the state’s bid for legitimacy.

Further, the more powerful these groups become, the less likely they are to be satisfied with taking a backseat to political elites in Baghdad and Damascus. For a cautionary tale, look to Lebanon. The Iranian-backed Hezbollah arose, in part, because of the state’s weak defense against Israel in the 1980s. The Lebanese state even blessed Hezbollah as a resistance movement against Israeli occupation in the country’s south, but it did not foresee the group’s evolution into the country’s most prominent political party, which derives much of its power from its military might.

If Baghdad and Damascus are achieving small victories today, they may find themselves facing a crisis of legitimacy tomorrow.

Iran and Russia, given their support of the groups operating in Iraq and Syria, may also use these militias as political tools to exert influence over the two countries and strengthen their reach in the Middle East. This is similar to Iran’s use of Hezbollah to capture the Lebanese state. This would further chip away at state sovereignty. Hezbollah, after all, is now known as “a state within a state” although it is really more like a state within a shadow state due to the weakness of the Lebanese government.

It is not difficult to imagine the militias using their current popularity to launch themselves into positions of power. In Iraq, some PMF groups are led by figures who have achieved popularity within the Shia community as a result of their track record against ISIS and who have expressed interest in contesting the upcoming local and parliamentary elections. The danger is that once in power, these groups could hold the political system hostage. In Lebanon, Hezbollah has been less likely to integrate with state structures, such as the Lebanese Armed Forces, under the pretext that those structures are weak. The reality is that Hezbollah has actively sought to keep Lebanese state institutions feeble in order to justify its possession of weapons—that it does so in the name of national defense. Those weapons are then used to intimidate local political opponents, making Hezbollah the main driver of the country’s political process. The current gridlock in Lebanon—it has been without a president for more than two years and parliamentary elections have been frozen—is a direct result of this state capture. In Iraq and Syria, the militias might eventually work actively to ensure that the state remains weak so that they can stay strong. And so, if Baghdad and Damascus are achieving small victories today, they may find themselves facing a crisis of legitimacy tomorrow.