Since the Islamic State first announced its presence in Libya in late 2014, it has expanded to attack cities across much of the country, ranging from Benghazi in the east to Misrata and Tripoli in the west, and even in the southern deserts. At this point, the self-proclaimed Islamic State in Libya includes thousands of fighters, possibly 3,000 or even 5,000, with many of them being foreign volunteers from Tunisia, Algeria, Egypt, or Saudi Arabia.

Even though some observers tend to portray the rise of the Islamic State in Libya as the result of a ruthless and brilliant strategy, its advance appears to be largely opportunistic, occasioned by the fissures, distraction, and incapacity of rival factions. Where the group senses an opening, it moves, tapping into various kinds of disenchantment to divide opponents and attract potential recruits, whether among disillusioned Islamists, aggrieved tribes, or marginalized minor factions.

While it is hard to speak of a coherent strategy of the Islamic State in Libya, one consistent element of its approach has been to weaken other Islamist groups, in order to present itself as the only viable alternative for Islamists in the country.

Peeling Away Ansar al-Sharia

At the heart of this approach lies the struggle for dominance over the hard-line jihadi movement in Libya. The Islamic State is aggressively challenging Libyan supporters of al-Qaeda, in particular the jihadi faction known as Ansar al-Sharia, for the hearts and minds of their young followers. In this, the Islamic State has been aided by the recent death of the Ansar al-Sharia leader Mohammed al-Zahawi as well as by battlefield attrition of rank-and-file Ansar al-Sharia fighters in eastern Libya, where they are embroiled in a separate conflict against Operation Dignity, an alliance of anti-Islamist militias under the command of Lieutenant General Khalifa Hifter.

In recent months, several Ansar al-Sharia members, including prominent leaders of the group, have defected to the Islamic State. For example, the leading religious scholar Abu Abdullah al-Libi swore allegiance to the Islamic State in March. He was reportedly replaced by Abu Tamim al-Libi.

The fracturing of Ansar al-Sharia after Zahawi’s death has been encouraged by the Islamic State, whose supporters accuse their rival of a variety of alleged religious and political flaws and portray the Islamic State as the only credible alternative. In a fiercely critical online letter, the self-declared Islamic State supporter Abdul-Majid al-Sufouq accused Ansar al-Sharia’s leaders of having deviated after the death of Zahawi, charging that Zahawi himself had wanted to join the Islamic State but was too busy fighting in the period before he died. In Sufouq’s telling, Ansar al-Sharia has become ineffective after Zahawi’s death, because the new and weakened leadership is too obsessed with trying to prevent more members from joining the Islamic State.

However, Ansar al-Sharia is actively engaged in countering the Islamic State’s appeals. A few months ago, the group launched an online magazine of which it has so far published thirteen brief issues. It has also been advertising its activities in the fight against Hifter’s forces outside of the northeastern city of Derna, as well as its social services such as providing for patients and organizing activities for children in Derna. Other publications highlight Ansar al-Sharia’s crackdown on Christians as well as on “vices” such as cigarette smoking. Ansar al-Sharia has even announced a wanted list targeting Hifter and some of the key commanders in Operation Dignity—prizes range between 25,000 and 100,000 Libyan dinars.

Ansar al-Sharia now seems to be reorganizing itself after the blows it received following Zahawi’s death. Recently, Ansar al-Sharia members declared the Ajdabiya Revolutionaries Shura Council, which has been involved in clashes against tribal forces that sided with the Hifter campaign in the strategic oil town of Ajdabiya. The group also seems to have stepped up its battle against the Islamic State. It is interesting to note that the June 14 U.S. airstrike in Ajdabiya, which may or may not have killed the al-Qaeda–linked Algerian extremist Mokhtar Belmokhtar, reportedly targeted a gathering of Ansar al-Sharia and allied jihadis planning attacks against the Islamic State.

A Step Too Far in Derna?

Another Islamic State effort has been its attempts to consolidate control in Derna through a campaign of intimidation and, most recently, through violent clashes with militia and tribal rivals. But these plans now seem to have backfired.

In Derna, the Islamic State’s draconian governance was on full display. The group has been confiscating cigarettes and other banned items, it has set up its own police force and court system, it has segregated schools and banned certain subjects from the curriculum, while attempting to enforce a strict dress code for women and carrying out public lashings and executions.

The overbearing attitude of the Islamic State has run into stiff resistance from local families and tribes, some of whom have thrown their weight behind rival Islamist factions. In late April, the Islamic State launched a brutal crackdown on its opponents in the al-Harir family, which belongs to the Obeidat, a very powerful tribe in Derna and other areas of northeastern Libya. Clashes ensued, with the Islamic State reportedly suffering several deaths in its own ranks, including the local leader Hasan Boudhahab. According to these reports, the Islamic State tried to set an example by publicly crucifying the corpses of some of the al-Harir men. But protests did not subside. More recently, on June 12, Derna residents demonstrated against the Islamic State’s presence in their city and against the foreign fighters in its ranks. As the demonstrators marched toward the Islamic State’s base, armed men reportedly shot at the protesters, killing several and wounding around 30 people.

A key obstacle to the Islamic State’s consolidation in Derna was the Derna Mujahedin Mujahideen Shura Council (DMSC), a coalition of rival Islamist militias formed last December under the leadership of Salim Darbi, head of the Abu Salim Martyrs Brigade. (Also included in the coalition is the jihadi veteran and ex-Guantanamo prisoner Sufiyan bin Qumu’s local wing of Ansar al-Sharia.) Evincing a hard-line Islamist vision for the Libyan state and some ideological affinity for al-Qaeda, Darbi and his group have long been opponents of the Islamic State. This rivalry has alternated between open gun battles and tacit cooperation against Hifter’s forces in Benghazi.

Recent months saw an uptick in fighting. In February, a morality patrol (hisbah) building belonging to the Islamic State was attacked, most likely by the DMSC. For its part, the Islamic State escalated its assassination campaign against the DMSC. Most recently, it killed Nasser al-Akar, known as Abdullah Saber, a veteran of the 1990s jihadi group known as the Libyan Islamic Fighting Group who had emerged as a DMSC leader. This sparked intense gun battles that killed Husam Burashid, a local leader of the Islamic State, and, most significantly, Salim Darbi himself.

Darbi’s death reverberated across Libya’s factional divides. His killing was mourned by the Islamist politician Abdelhakim Belhaj—who formerly led the Libyan Islamic Fighting Group, a loosely al-Qaeda–linked jihadi faction most active in the 1990s—as well as by the official media outlets of Operation Dawn, an alliance of Islamist forces aligned with armed groups from Misrata. Following Darbi’s death, the DMSC released a statement attacking the Islamic State as modern-day Kharijites, a reviled historical group that renounced all Muslims who did not subscribe fully to its views, and declaring jihad against it. Three days later, on June 13, the DMSC launched an offensive against the Islamic State in Derna. The DMSC reportedly captured a Yemeni who served as the Islamic State’s local commander and killed several of its members. Islamic State fighters are reportedly still present in a few pockets where clashes are occurring, but they are widely seen as having been defeated in most of Derna.

Operation Dignity Fumbles Its Derna Offensive

Thus far, Operation Dignity forces have been unable to exploit the jihadi infighting in Derna, remaining stationed outside of Derna while conducting air strikes in and around the city. In May, reports emerged that Operation Dignity was planning to launch a campaign to capture Derna from the Islamists. The operation was to be comprised of both regular Libyan National Army units and Obeidat tribal forces. It was to be led by Lieutenant-General Suleiman Mahmoud al-Obeidi (of the Obeidat) and his deputy, Colonel Faraj al-Barasi, a member of the Baraasa tribe, which has been a major component of Operation Dignity forces.

However, the operation stalled, for several reasons. Suleiman reportedly has strained relations with the overall commander of Operation Dignity, Lieutenant-General Khalifa Hifter, and may in fact lack strong support among his fellow Obeidat. Tribal mobilization against the Islamic State is complicated by the Obeidat’s decentralized nature and fractured leadership, with members inside Derna split along political lines: some opportunistically back the Islamic State to help them in local disputes, while others support Operation Dignity. In addition, Hifter, who hails from the Farjan tribe, is reported to have poor relations to many Obeidat leaders. Some of these disputes may stem from when he wrestled for control over the early uprising with Abdelfattah al-Younes, a former Libyan minister of interior and Obeidat tribesman who was murdered by Islamists in July 2011.

On June 15, Hifter also removed Colonel Barasi from his military duties, reportedly angering the Baraasa tribe. Barasi’s position had been subject to controversy, with Hifter seeking to sideline him, even though he enjoys the support of the speaker of the Operation Dignity–backed Libyan parliament in Tobruk and local tribal notables. The confusion over Barasi’s role exemplifies the disorganization of Operation Dignity ranks that has allowed extremists within Derna to thrive, including the DMSC and—until this month—the Islamic State.

Forging Ahead Among Fractured Rivals

The Islamic State may lack a coherent strategy in Libya, but its attempts at dividing and upstaging Islamist forces is a well-practiced tactic, previously tried out in Syria. By weakening and preying on those closest to its own ideology, the Islamic State seeks to recruit young fighters who are avowed Islamists and who look for a strong champion of their values against Operation Dignity, but whose organizational loyalties are fluid. The idea is that many will be drawn to its uncompromising radicalism or simply endorse the Islamic State as the strongest contender, in order to unify Islamist ranks.

But as the backlash in Derna demonstrates, this is a strategy fraught with risks—and at this point, the Islamic State’s aggressive behavior has made enemies of most of Libya’s major Islamist factions, ranging from relative moderates in Libya Dawn to extremists such as Ansar al-Sharia and the DMSC. Still, these groups are divided by internal rivalries as well as by geography, and it remains to be seen if they can close ranks to block the advance of the Islamic State.