In recent weeks, a succession of U.S. and European officials have warned that military operations to stop the creeping advance of the Islamic State (ISIS) in the shattered North African state of Libya are imminent. Since the summer of 2014, ISIS has exploited a governance vacuum and a factional civil war in Libya to expand what was once just a toehold into a foothold. It has clashed with, and in some areas displaced, older jihadist groups affiliated with al Qaeda. It has used Libya’s lawlessness to attract foreign recruits, conduct training, and plot operations abroad. ISIS now controls the central coastal city of Sirte and is attacking the nearby petroleum facilities to prevent much-needed revenue from reaching Libya’s central bank. And perhaps most worrisome, U.S. officials recently stated that ISIS has sent hundreds of fighters from Iraq and Syria to Libya in a calculated fallback strategy; the total number ISIS fighters in Libya is estimated between 3,000 and 6,500.

There’s no doubt that the ISIS presence demands a forcible response, above all from Libyans themselves, backed by Western support. That assistance is likely to involve special operations forces—who are reportedly already on the ground—liaising with, training, and advising Libyan units, backed by aircraft using precision-guided munitions. But this approach carries great risks. The West must proceed carefully, or else it could exacerbate Libya’s political fractures, encourage warlordism, or undermine attempts to re-establish a single government and lay the basis for a cohesive and civilian-controlled military. Any strategy to tackle ISIS should first aim at bridging Libyan political divides and channeling assistance in a way that promotes cooperation between rival forces.

Libya's Failed State

For Libyans and Western governments alike, the biggest obstacle to confronting ISIS is Libya’s broken state. For the past year and half, the country has been split into two loose constellations of political factions and armed actors. The first is the Tripoli-based “Dawn” coalition, which comprises Islamist fighters and militias from the western part of the country. The second is the “Dignity” umbrella, which is drawn from eastern tribes, federalists, some western militias, and Qaddafi-era officers recruited into a self-styled “Libyan National Army” led by General Khalifa Hifter. In the past year, internal power struggles have fractured these two groups to the point that they exist only in name. Worse, both have been so focused on preventing rivals from gaining ground that they’ve allowed ISIS to expand, often cynically using the terrorist group’s presence to accuse their adversaries of collusion.

Representatives from the two sides recently signed a UN-brokered agreement to form a unity government, which, Western officials hope, will soon issue a formal invitation for military assistance. But the unity agreement is fragile and incomplete, having been pushed through under Western pressure despite resistance from key local players. The Presidency Council, the nine-member executive body established by the agreement, has started to falter before even having managed to form a government. Unless it can obtain the formal support of Libya’s two rival legislatures and take office in the capital, Tripoli, the unity government will be widely perceived as a Western puppet.

Even if the Presidency Council does overcome the initial hurdles, moreover, it will quickly face the daunting task of re-establishing centralized military command and building loyal, integrated units out of a collection of disparate armed factions. A key stumbling block is Hifter’s continued presence as commander in chief of the Libyan National Army. The Dawn bloc insists that he go; the Dignity faction’s failure to remove him gives fuel to rejectionists in the rival camp and precludes the creation of a single chain of command under the new government. The loose alliance that Hifter leads is itself rife with personal and factional rivalries: The majority of his forces in Benghazi are not uniformed army troops but irregular neighborhood and tribal militias. Meanwhile prominent army officers on the frontlines are themselves rivals of Hifter.

Planning in Western capitals appears ignorant of these challenges. Two options are currently on the table: a training program to stand up new army units loyal to the government and a counterterrorism effort focused on providing assistance to those forces on the ground that are most capable and most willing to confront ISIS. Neither option offers a remedy to the problem of factionalism in Libya’s security sector—and both could make matters worse.

The training program is based on the flawed premise that Libya lacks skilled fighters. In fact, it has lacked governments capable of bringing skilled fighters under state control. A Western training effort in 2013–14 to build a national army—the so-called general purpose force—failed because there were no national structures for recruits to join: rival political interests in Libya’s state institutions had turned the security sector into a hodge-podge of factional militias. Another training program risks simply repeating this error unless the Presidency Council can agree on a realistic roadmap for building a unified and professional military. In the best-case scenario, such efforts would result in a reliable military for future governments to use. But it would not offer an immediate response to the urgent ISIS threat.

In the meantime, Western governments will seek to back existing forces against ISIS. And that is where the problem lies. By liaising with and assisting armed groups against ISIS, Western special operations could empower factional rivals and reduce the incentives for political reconciliation. A previous counterterrorism assistance program is instructive in this regard. U.S. counterterrorism training from 2012–13 was focused on the 22nd Libyan Special Operations Battalion, a unit that, by its commander’s own admission, was narrowly drawn from certain Western mountain cities and whose definition of terrorist ended up including its own rivals.

In addition, navigating the patchwork of competing militia claims will be a daunting challenge. In setting up a physical presence on the turf of a particular faction, Western special operations forces could create the impression of partisanship, causing rivals to seek out counterbalancing alliances. This risk of blowback is especially dire in Sirte. The most powerful militias equipped to liberate Sirte from ISIS control are from the nearby coastal city of Misrata. But an explicit U.S. and European partnership with Misrata would antagonize Sirte’s population, which in 2011 suffered abuses when Misratan militias overran the territory. By the same token, simultaneous Western support to militias to the east of Sirte, such as the Petroleum Facilities Guard under Ibrahim Jadran, could end with those militias turning their guns on their Misratan rivals in a scramble for the region’s oil resources.

Western intervention, particularly airstrikes, could set in motion other unintended consequences as well. A sustained campaign of Western airstrikes and the visible presence of Western troops could threaten the fragile basis on which the new unity government relies. Such interventions would hand new ammunition to spoilers and rejectionists, who will accuse the new government of surrendering Libya’s sovereignty. Likewise, ISIS and al Qaeda would gain new grist for their propaganda mills. In fact, Western expectations that the new unity government will request foreign assistance are likely overstated—precisely because the government must understand the dangers.

The Right Way to Intervene

Counterterrorism assistance must proceed hand-in-hand with building inclusive political and security institutions. The two should be mutually reinforcing. Instead of a training mission or a direct intervention in the form of airstrikes, the West’s priority should be to support the establishment of integrated structures and units in the security sector. At the political level, that will require intensive engagement to overcome the standoff over the army leadership and promote cooperation between representatives of rival factions in the Presidency Council, its government, and the military command. 

On the ground, the West must tie assistance for the fight against ISIS to a process of integration of armed groups. To be eligible to receive counterterrorism support, for example, armed groups should accept the unity government and subordinate themselves to its national command structure. But that won’t be enough. To avoid empowering individual factions and fuelling factional conflict, Western military assistance must also include the establishment of coordinating mechanisms between Libyan military forces on the ground. These could include joint command centers between militias on a regional basis, with the aim of gradually creating integrated command structures and, eventually, dissolving local factions into integrated army units. Western advisors should encourage militias from Misrata, Ajdabiya, and southern Libya, for example, to cooperate with army officers from Sirte to lead the offensive against ISIS in the city.

Regional command centers would be staffed by local army officers, militia commanders, and foreign special operations advisers who would facilitate the transfer of intelligence, de-conflict ground movements with airstrikes, and, perhaps most importantly, act as neutral political arbiters. For such assistance to work, Western states—France, the United Kingdom, and the United States—will need to coordinate their efforts closely. They will also need to ensure that regional military forces from Egypt, Qatar, and United Arab Emirates support this strategy and do not attempt to set up parallel advisory and assistance channels—these states’ previous meddling has been deeply partisan and unhelpful in both combating ISIS and resolving Libya’s civil conflict.

Above all, Western involvement in Libya should be geared toward supporting the unity government, which will need to back any efforts to promote battlefield coordination among regional militias. No single faction should receive assistance unless it is considered both neutral in local power struggles and loyal to the unity government. Further, if the government makes progress on re-unifying command structures, Western assistance should flow through a national chain of command, rather than directly to regional coordination centers. Of course, if the council remains paralyzed by internal divisions or the agreement collapses, the Western backed regional coordination centers will have no chance of ever evolving into a foundation for an integrated military. At the very least, however, the strategy will reduce the risk that military assistance will widen political rifts and contribute to the failure of the unity government.

Alarmist assessments of ISIS in Libya should not lead to a hasty and heavy-handed intervention. ISIS may be expanding its presence in Libya, but it has not been able tap into the popular discontent of broad segments of the population—yet. Unlike in Iraq or Syria, ISIS cannot prey on sectarian fears. It has not shown an ability to set up durable governance structures in areas it controls. Libya still has multiple societal and political actors capable of and willing to fight back against the group. The Western approach should work carefully to ensure that it harnesses and unifies them rather than dividing them

This article was originally published at Foreign Affairs.