Derna campaign (2014–15)

In October 2014, the self-declared Islamic State of Iraq and the Levant (ISIL) took control of numerous government buildings, security vehicles and local landmarks in the Eastern Libyan coastal city of Derna. Although some media outlets have reported the control as being absolute, rival groups like the al-Qaeda-affiliated Abu Salim Martyrs Brigade continued to control parts of the city. Clashes erupted between ISIL and an alliance of Islamist groups, which succeeded in expelling a majority of ISIL forces from Derna by 15 June 2015, with the rest of them forced out by 30 July 2015. However, clashes continued between the other jihadist groups and the Tobruk-based government forces.

Background
The city of Derna has been considered the most pious Muslim city in Libya and has a long history of Islamist radicalism. In 2007, American troops in Iraq uncovered a list of foreign fighters for the Iraqi insurgency and of the 112 Libyans on the list, 52 had come from Derna. Derna contributed more foreign fighters per capita to al-Qaeda in Iraq than any other city in the Middle East and the city has also been a major source of fighters in the Syrian Civil War and escalation of the Iraqi insurgency, with 800 fighters from Derna joining ISIL.

ISIL takeover of Derna
On 5 October 2014, the ISIL-linked militant factions came together and pledged allegiance to ISIL. After the pledging ceremony, more than 60 pickup trucks filled with fighters cruised through the city in a victory parade. A second more formal gathering took place on 30 October, where militants gathered to pledge allegiance to Abu Bakr al-Baghdadi in the city square, where a handmade bomb was detonated.

Libyan airstrikes and planned assault
On 12 November 2014, Libyan Air Force fighter jets carried out airstrikes in Derna, possibly in retaliation for the car bombs which exploded in Benghazi, Tobruk and the Labraq Airport. Six ISIL militants were killed and 20 militants were wounded. According to Human Rights Watch, some residents have fled the city in advance of an announced Libyan Armed Forces assault on Derna. Approval for a Libyan Army ground assault on Derna was given on 6 December 2014 and army units moved within a few kilometers of Derna, retaking control of villages and roads leading to the city. From December 2014, US drones and electronic surveillance planes began making "constant flights" from Italian bases over Derna. On 25 March 2015, the Tobruk-based government announced it was launching an offensive on the city of Derna, to expel ISIL and other militant groups from the city.

Egyptian military airstrikes
On 15 February 2015, the Islamic State in Libya released a video depicting the beheading of 21 Coptic Christians from Egypt. Within hours, the Egyptian Air Force responded with airstrikes against IS training locations and weapons stockpiles, killing 50 militants in Derna. Warplanes acting under orders from the "official" Libyan government also struck targets in Derna, reportedly in coordination with Egypt's airstrikes. A Libyan official stated that more joint airstrikes would follow.

2015 Battle of Derna
On 25 March 2015, the Libyan Army besieged the city of Derna, in preparation for a future offensive on the city.

In May 2015, reports emerged that Operation Dignity was planning to launch a campaign to capture Derna from the Islamists. However, the operation stalled, due to tensions between Dignity commanders and affiliated tribes. The Tobruk-based government attacked a Turkish cargo ship on 15 May 2015, which the Tobruk-based government claimed was heading towards Derna with weapons for ISIL and had allegedly refused to change course after being warned.

The Shura Council of Mujahideen in Derna, an umbrella organisation of Derna-based Islamist factions opposed to ISIL, launched an offensive against ISIL in June 2015, following its involvement in the killing of two of their leaders. After days of clashes, they were reportedly able to push ISIL out of large portions of the city. On 15 June 2015, ISIL was largely expelled from Derna by the Abu Salim Martyrs Brigade, but clashes continued between the other jihadist groups and the Tobruk-based Government forces. On the same day, the Tobruk-based government forces were able to capture the western outskirts of Derna, as well as the roads leading towards that area. On 20 June 2015, dozens of ISIL militants were killed in the Fataeh District of eastern Derna, in clashes between ISIL militants and the Derna Shura Council. Fataeh District was reportedly the last area of Derna where ISIL still had a degree of control. Taking advantage of ISIL's collapse in the city, the Shura Council of Mujahideen in Derna began to impose their own rule and Libyan Army forces began to advance on the city. On 30 July 2015, the last ISIL militants in Derna were fully expelled from the city.