Fighting between armed groups in western Libya over the last few weeks has thwarted domestic and international efforts to bring the violence to a close, underscoring the ongoing fragility of security in the north African country.

Rival militias have clashed in Tripoli, Libya over the last few weeks, sparked by the deaths of 39 people and 119 others who were wounded, according to an August 30 statement posted by the Ministry of Health of the U.N.-backed Government of National Accord (GNA). The violence between competing armed groups in and around Tripoli highlights the massive security vacuum that has developed in the north African country since the fall of former dictator Muammar Gaddafi in 2011. The country will face additional challenges in December, as it prepares for upcoming democratic national elections agreed upon at a summit held in Paris in May, and attempts to implement the outcome peacefully.

Fighting erupted in the suburbs of Tripoli on August 26 when the Seventh Brigade, also known as Kaniyat, from the southeastern Tripoli suburb, Tarhouna, attacked the Tripoli Revolutionaries’ Battalion (TRB), and its allies: the 301, Rada, the Abu Salim Brigade, and Nawasi.

Clashes continued until the evening of August 29, when the groups briefly agreed to a ceasefire. Unfortunately, the violence resumed later the next day; many residents fled or were evacuated from the area to escape the heavy artillery and airstrikes.

The clashes were partially motivated by the GNA’s consolidation of power over armed groups operating in the capital city. A reduced number of militias in Tripoli, however, has led to the concentration of power in a few armed groups in the capital city. The Seventh Brigade and other militias outside of Tripoli are increasing resentful of these powerful Tripoli militias, such as the TRB.

“[T]he profits derived from the capture and misappropriation of state resources are now concentrated within a small group of actors who are mostly from Tripoli itself.”

According to researcher Wolfram Lacher, a senior associate at the German Institute for International and Security Affairs (SWP), “[T]he profits derived from the capture and misappropriation of state resources are now concentrated within a small group of actors who are mostly from Tripoli itself.” He added, “[T]hat’s a very dangerous situation because it excludes powerful forces from access to levers of the state and administration, and this is now causing those forces to build alliances against the big militias in Tripoli.”

The militias are all loosely affiliated with the GNA. The TRB and Nawasi are associated with the Ministry of Interior and the Seventh Brigade operated for a time under the Ministry of Defense. The head of the GNA, Fayes al-Sarraj, however, claims that the Seventh Brigade has been dissolved since April.

The Presidential Council (PC), which presides over the GNA, condemned the GNA over the violent clashes in a statement: “We warn these gangs and outlawed groups that have terrorized civilians and residents [that] there is no space for such lawlessness and chaos. We have given orders to the interior ministry to counter these attacks.”

The U.S., U.K., and France also issued a joint statement condemning the persistent escalation of violence in Tripoli and its environs. The statement reads: “[W]e are calling on the armed groups to immediately stop all military action and warn those who seek to undermine stability, in Tripoli or elsewhere in Libya, that they will be made accountable for it.” The U.N. mission to Libya echoed its concern over “the use of indiscriminate fire and heavy weapons in densely populated residential areas, endangering civilian lives, and reminds all parties of their duty to protect civilians, in accordance with international humanitarian and human rights law.”

The clashes have affected many non-combatant civilians, including children. Human Rights Watch reports that 18 of those killed were civilians and four were children. Additionally, thousands of migrants and refugees were reportedly trapped in state detention centers throughout Tripoli without food or water after guards fled their posts due to the fighting.

The U.N. relocated around 300 migrants from the Ain Zara area in southeastern Tripoli to the Abu Salem detention center in Tripoli, which was deemed a “safer location.” However, Doctors Without Borders (MSF) claimed on August 31 that some 8,000 detainees were still at risk. Ibrahim Younis of MSF in Libya stated, “[T]he recent fighting demonstrates that Libya is not a safe place for migrants, refugees and asylum seekers.”