In a region with no shortage of human catastrophes, Libya seems determined to elbow its way into the headlines. Rival militias are fighting for control of Tripoli’s international airport. In the east, a breakaway faction of the Libyan armed forces led by a retired general, Khalifa Hifter, is shelling Islamist militias in and around Benghazi. Foreign diplomats, businesspeople, the U.N. mission and now the U.S. Embassy have evacuated.

Libya is clearly entering a dangerous new phase, but conventional readings of its politics misdiagnose the problem and offer solutions that will fail or even make things worse. Here’s why.

Outside observers are often tempted toward a one-dimensional reading of Libya’s turmoil. It is easy to trace Libya’s breakdown as a political struggle between Islamists and liberals: The Muslim Brotherhood-affiliated Justice and Construction Party and more rejectionist, jihadi factions like Ansar al-Sharia versus the “liberals” under the National Forces Alliance (NFA). Another level of conflict seems to be regional: A contest between the towns of Zintan and Misrata for economic power and political leverage in Tripoli, or amongst federalists and their opponents in the long-marginalized east. Yet an additional layer is between remnants of the old order – ex-security men, long-serving and retired officers, former Gaddafi-era technocrats – and a newer, younger cadre of self-proclaimed “revolutionaries,” often Islamists, who were either exiled and/or imprisoned during the dictator’s rule.

Elements of all these dimensions are at play, but none of them alone has sufficient explanatory power. At its core, Libya’s violence is an intensely local affair, stemming from deeply entrenched patronage networks battling for economic resources and political power in a state afflicted by a gaping institutional vacuum and the absence of a central arbiter with a preponderance of force. There is not one faction strong enough to coerce or compel the others.

As much of the literature on post-conflict disarmament, demobilization and reintegration suggests, it is this absence that has confounded efforts by the Libyan government and outside supporters to dismantle the militias and create unified, cohesive security institutions. But more recent work on state-building argues that the Weberian notion of a complete monopolization of violence by the state has always been elusive and is becoming more so, often associated with great human costs. As political scientist Ariel Ahram observes in his study of state-sponsored militias, “many efforts to strengthen states and eliminate militias have proven quixotic, if not counterproductive.”

I’ve made five trips to Libya since 2011 – the most recent in late June – and have met with the leaders of many of the country’s key militias, the central actors in the country’s spiraling violence. Too often, these militias are thought to be outside of Libyan society and of the state. In fact, they are deeply interwoven into both.

One of Libya’s conundrums is that nearly all the militias claim legitimacy from their affiliation with competing organs of the weak and fractured government. Government subsidization of militia power arose from the enfeebled state of the formal army and police, which Moammar Gaddafi had marginalized in favor of elite units commanded by his sons and which had largely evaporated during the revolution. Bereft of a way to project its authority and police the country’s periphery and towns, Libya’s transitional authorities, the National Transitional Council (NTC), put the militias under its payroll. The chief of staff, minister of defense, minister of interior, and president of the outgoing General National Congress (GNC) have all at one time “registered” or “deputized” militia coalitions. One result of these subsidies has been a mushrooming of militias, well beyond the number that actually fought against Gaddafi.

What has arisen then can best be described as a “hybrid security order” – a concept that has been explored in the African context but not sufficiently applied to Arab states. Drawing also from work on warlords by Kimberly Marten and insurgent political orders by Paul Staniland, the concept of hybridity is helpful in the Libyan case for describing how the “formal” forces of the army and police work in loose and often suspicious coordination with more powerful “informal” militias that fall under the nominal writ of the government, backed by traditional tribal and religious authorities.

The results of this arrangement in Libya have been mixed according to locale. In some homogenous communities where the militias enjoyed organic roots and social ties, militias played a role akin to a local gendarmerie, performing functions like narcotics interdiction, guarding schools and hospitals, and even street maintenance. But in mixed or strategically important locales, namely Tripoli and Benghazi, they have evolved into dangerously parasitic and predatory entities, pursuing agendas that are at once criminal, political and ideological.

Contrary to some assumptions, no one faction is blameless on this front. Islamist, Misratan, Zintani and federalist militias have all used force or the threat of force to pressure the country’s elected institutions, capture smuggling networks, or seize strategic assets like border checkpoints, oil facilities, armories, ports and, perhaps most importantly, airports. As the arteries that connect Libya’s centers of power to one another and to the outside world, airports are at once economic prizes, venues for weapons smuggling, and sources of political leverage. In one sense, then, this latest round in Libya’s conflict is its “war of the airports.”

Aside from the NTC’s fateful decision to subsidize the militias, the current fighting has its roots in the ineptitude and polarization of the GNC. Since being elected in July 2012, the legislature’s composition had become steadily skewed in favor of Islamist factions due to disarray, defections and dilution in the NFA bloc. The Islamists had strengthened the Islamist and Misratan-dominated militia coalitions – certain divisions of the Libya Shield Forces under the chief of staff and the Libya Revolutionaries’ Operations Room (LROR), first under the GNC president and later under the chief of staff – at the expense of the regular army and police forces, many of them commandeered by anti-Islamist figures from Zintan or the east.

It was in the east where this bias and polarization was most acutely felt. Rejectionist Islamist militias like Ansar al-Sharia were becoming increasingly entrenched and assassinations of former and current security personnel, activists, religious figures and tribal leaders had become a daily occurrence. Security in Benghazi, such as it was, had long depended on an uneasy cooperation between the local military units (namely, the Special Forces) and Benghazi-based Islamist militias subordinated to the chief of staff. Members of these “registered” Islamist militias enjoyed friendly relations with Ansar al-Sharia based on ideology, incarceration and battlefield camaraderie. Commanders of two of these Islamist militias told me in 2013 that a key disagreement with Ansar al-Sharia was its unwillingness to affiliate itself with the state prior to the establishment of an Islamic constitution.

In the context of growing polarization in Tripoli, this hybrid security arrangement in the east began to break down. Faced with what he perceived of the GNC’s malign neglect of the army, if not its active collusion with the Islamist militias, Hifter began quietly building coalitions with eastern tribes opposed to local Islamists and disaffected military units in the east. Operation Dignity was born.

On May 16, military forces belonging to Hifter’s self-styled “Libyan National Army” began shelling bases in and around Benghazi belonging to Ansar al-Sharia, the February 17th Martyrs’ Brigade, the Libya Shield One, and the Rafallah al-Sahati Companies. The pro-Hifter forces included eastern air force units, the Benghazi-based Special Forces, the navy, and prominent political personalities like NFA chairman Mahmoud Jibril. Local tribal militias opposed to the Islamists sided with him. Significantly, one of these militias controls Benghazi’s Banina Airport (which is also used by air force units loyal to Hifter). In the west, Zintani militias, which control Tripoli’s international airport, joined his movement, although their cooperation should be seen as ultimately tactical since they clashed with his forces in the west in 2012.

Appropriating the tone and language of Egypt’s former general President Abdel Fattah al-Sisi, Hifter saw his goals as reaching far beyond evicting the Islamist militias from Benghazi to a purge of the Brotherhood from Libya. The GNC lay at the center of his contempt. “It is supposed to be democratic, but it is dictatorial,” he told me in June. He drew no distinction between Ansar al-Sharia and “registered” formations like the Libya Shield One and Rafallah al-Sahati Companies. He ruled out the possibility of compromise: “There are three options for them: death, expulsion from the country or imprisonment.”

By lumping all the Islamist militias into one category and by initially attacking the Brotherhood itself, Hifter introduced a dangerous new dynamic into Libyan politics that is breeding polarization and radicalization. His self-proclaimed showdown with terrorists may become a self-fulfilling prophecy as Libyan jihadists are reported to be returning back from Syria and Iraq to fight him.

Hifter told me that the operation would not stop in Benghazi but would eventually come to Tripoli. From the start of his campaign, there were intimations of this happening. Hifter’s allied militias from Zintan attacked the GNC, which tried to solicit, unsuccessfully, help from its allied militias in Misrata. On the evening of May 18, a group of five military officers led by Hifter announced that the GNC would be suspended and that the 60-member Constitutional Drafting Assembly would carry out its work. A catastrophe was averted with the announcement of elections for a successor to the GNC, a Libyan parliament called the Council of Representatives (COR).

Those elections, held on June 25, produced results that were unfavorable to Islamists. For the LROR and its allied militias, then, the balance was turning against them. They had suffered at the polls and the country’s two main airports were in the hands of their opponents, the pro-Hifter forces. Most alarming was the prospect that eastern Hifter forces would rely upon their newfound Zintani allies at the airport to bring the fight to the capital

On July 13, the LROR, later backed by militias from Misrata, some Tripoli neighborhoods, and surrounding towns, began shelling the Tripoli International Airport, in what was dubbed “Operation Dawn” – a direct response to “Operation Dignity.” This was not just an effort to drive the Zintanis from Tripoli airport, but from strategic installations across Tripoli, thus shifting the balance-of-power in the capital and, perhaps, in the east. An unstated goal may have been to shut down Tripoli airport so that all air traffic in western Libya would be routed through Misrata and Mitiga airports, which are controlled by Islamist militias. Already, this “war of the airports” has affected national politics. Islamist militiamen at Mitiga recently prevented Prime Minister Abdullah al-Thinni, whom they perceive to be close to Hifter, from traveling to the east. For their part, newly elected parliamentarians from Misrata have received threats if they fly to Benghazi via the only operational airport in the nearby city of Bayda, in the hands of Hifter supporters.

What is to be done? Beyond an immediate cease-fire, in both Tripoli and Benghazi, the country needs to convene its new parliament, the COR, and complete the work on the constitution. The COR is set to meet in Benghazi, but there are questions about its security and whether it will be vulnerable to the same militia pressure that afflicted the GNC. Hifter’s forces have reportedly offered to guard the parliament, but they are a hardly a neutral party. The prime minister’s office is reportedly planning a new, 500-person “security force for the parliament,” but its composition and operational chain-of-command are unclear. Aside from these security concerns, the COR must work to be an inclusive body and avoid the polarization that plagued its predecessor; there are already signs that its new members will work to legitimize Hifter’s operation while outlawing the LROR.

Contrary to some commentary, quickly bolstering the regular police and army so that they can intercede in militia fighting and insulate the country’s elected institutions from militia pressure is not a panacea. Absent a broad political compact among the factions, any future efforts to disarm the militias and impose a centralized security force on Libya’s fractured landscape is destined to fail. The militias will either oppose the new force with violence, or new trainees will simply melt back into the militia ether. And then there is the time horizon for standing up an army (by optimistic estimates six to seven years) and the danger that, like Iraq, a nepotistic ruler could undermine its cohesion.

Initial efforts thus far by the United States, Britain, Turkey and Italy to train Libyan soldiers at overseas bases as part of the roughly 20,000 strong “general purpose force” have produced dismal results. The U.S. plan has been put on hold because the Libyan government has not provided payment up front. In the training programs conducted by Turkey and, to a lesser extent, Italy, attrition rates were high due to poor vetting. Since April, the initial cadre of returnees from this training has been put on indefinite leave because there is no effective structure for them to join: Libya lacks the bureaucracy to support an army, and the militias are occupying its armories and bases. Some of these newly trained soldiers have reportedly gone over to fight with Hifter’s forces.

A separate program last year by U.S. Special Operations Forces to train an elite Libyan counter-terrorism force at a military base west of Tripoli known as Camp 27 focused on an 800-strong Libyan special forces battalion that, according to my interview in 2013 with its commander, was comprised overwhelmingly of Zintanis and other western tribes, to the exclusion of soldiers from the east and Misrata. The effort ended abruptly when western tribal militias seized the camp in the summer of 2013; the chief of staff subsequently turned the camp over to the Islamist LROR.

Libya’s factions need to agree on a comprehensive plan for militia withdrawal outside Tripoli and Benghazi (including Hifter’s forces) and a handover of bases, armories and other installations to the regular army and police. The lagging National Dialogue needs to be revived with international support, with one goal being a roadmap for building the security structure and integrating militia members as individuals, not units. Only then can outside powers assist in training and equipping the new security forces. They must ensure that the new force is defined by civilian oversight, broad regional representation in the rank-and-file and officer corps, and a clearly determined mission. The new force should be modeled on a localized gendarmerie or national guard-type force, rather than a bloated conventional military that has little applicability for Libya’s security environment. This will invariably mean harnessing and incorporating the hybrid security structures that have already developed in a number of communities across Libya – and that includes the militias. During this transition phase, the United States and international community can enforce parameters for behavior by militias by applying sanctions and travel bans on those militia leaders involved in the ongoing shelling of civilian airports.

At the most basic level, Libya needs to re-engage in the politics of recognition. The more secular, Gaddafi-era officers, politicians and technocrats need to recognize that the Islamists and younger revolutionaries have a place in the new order, provided they support state institutions and renounce ties with violent extremists. For their part, the Islamists need to recognize that not all former Gaddafi functionaries can be excluded from that order. And both Misrata and Zintan need to recognize that neither town alone will thrive in a zero-sum contest that is making a shambles of the Tripoli airport and, increasingly, of the country itself.

Frederic Wehrey is a senior associate in the Middle East Program at the Carnegie Endowment for International Peace and a frequent visitor to Libya.