Clashes erupt between the Shura Council of Mujahideen and ISIL in June 2015, with ISIL being expelled from the city by late July 2015, but ISIL again entered Derna in December 2015
ISIL began redeploying forces from its positions on the outskirts of Derna to other parts of Libya in April 2016
<th colspan="3" style="background-color: #B0C4DE; text-align: center; vertical-align: middle;">Belligerents</th>
<td style="width:33%; border-right:1px dotted #aaa;">Libyan parliament Egypt (Airstrikes) United States
</td><td style="width:33%; padding-left:0.25em">Islamic State of Iraq and the Levant
</td><td style="width:33%; padding-left:0.25em; border-left:1px dotted #aaa;">Shura Council of Mujahideen in Derna
<th colspan="3" style="background-color: #B0C4DE; text-align: center; vertical-align: middle;">Commanders and leaders</th>
<td style="width:33%; border-right:1px dotted #aaa;">Abdullah al-Thani (Prime Minister of Libya) Aguila Saleh Issa (President of the Libyan Council of Deputies) Brig. Gen. Saqr Geroushi (Commander of the Libyan Air Force) Air MshlYounes Hamed (Commander of the Egyptian Air Force)
</td><td style="width:33%; padding-left:0.25em">Abu Bakr al-Baghdadi (Leader of ISIL) Abu Nabil al-Anbari† (ISIL commander of North Africa)
Mohammed Abdullah (Top ISIL judge in Derna) Salah Benali† (Shura Council of Islamic Youth leader in Derna) Sofian Qumu (POW) (Senior ISIL commander)
</td><td style="width:33%; padding-left:0.25em; border-left:1px dotted #aaa;">Salim Derby† (Leader of the Abu Salim Martyrs Brigade)  Hassan al-Mansouri† (Commander of the Shura Council of Mujahideen in Derna) Hussam al-Nawaisri† (former leader of the Shura Council of Mujahideen in Derna)
<th colspan="3" style="background-color: #B0C4DE; text-align: center; vertical-align: middle;">Units involved</th>
<td style="width:33%; border-right:1px dotted #aaa;">Libya
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 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 in June 2015, with ISIL retreating from Derna to outlying suburbs the following month. However, clashes continued between the Islamist alliance and the Tobruk-based government forces.
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.
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.
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.[not in citation given]
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.
In March 2015, the Libyan National Army, affiliated with the Tobruk-based government, began to implement a siege of the city of Derna, in preparation for a future offensive on the city. However, by May 2015, the operation had stalled due to disputes between commanders and affiliated tribes.
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 able to push ISIL out of large portions of the city., but clashes continued between them and the Tobruk-based government forces. By July 2015, the last ISIL militants in Derna were expelled from the city, withdrawing to al-Fatayeh on the outskirt where they continued to clash with the Derna Shura Council. Taking advantage of ISIL's collapse in the city, the Shura Council began to impose their own rule and Libyan Army forces attempted to advance on the city. Following continued clashes, ISIL retreated from al-Fatayeh and positions in Derna's outskirts in April 2016, reportedly to the group's stronghold in Sirte.
The United States launched an airstrike at Derna on 13 November 2015, targeting senior ISIL leader Abu Nabil al-Anbari. Abu Nabil had previously led Al-Qaeda in Iraq operations between Fallujah and Ramadi from 2004 to 2010 before relocating to Libya. It was the first military action against ISIL by the United States outside of Syria and Iraq. The Libya Herald reported that Abu Nabil al-Anbari was not killed in the airstrike, however a eulogy to Abu Nabil al-Anbari was published online by a member of ISIL some weeks later and an interview with his replacement was published in an ISIL magazine in March 2016.