The city was also the location of the famous Battle of Derna (1805), the first victory achieved by the United States Military on foreign soil. Occurring during the First Barbary War, the battle was fought between a force of roughly 500 US Marines and Mediterranean mercenaries and four or five thousand Barbary troops.
Parts of the city were taken over by Islamic State of Iraq and the Levant (ISIL) militants in October 2014. In June 2015 Shura Council of Mujahideen in Derna defeated ISIL and took control over the town.
Darnis and Darne were the Greek forms of the name for the city. While the form Dardanis is sometimes found, it is erroneous. Under Rome the city was referred to as Darnis and Derna. Under Islam, it was known as Derneh (Derne, Dernah) or Terneh (Ternah).
In the Hellenistic period the ancient city of Darnis was part of the Libyan Pentapolis. Under Rome, it became a civil and later the religious metropolis of the province of Libya Secunda, or Libya Inferior, that is, the Marmarica region. The names of some of its metropolitan bishops are found in extant documents. Piso was one of the Eastern bishops who withdrew from the Council of Sardica and set up their own council at Philippopolis in 347. Early 5th-century Dioscorus is known because of a dispute he had with the bishop of Erythrum. Daniel took part in the Council of Ephesus in 431. In addition, John Moschus speaks of a bishop Thedodorus of Darnis as having had a vision of Saint Leo the Great in the mid-5th century.
No longer a residential bishopric, Darnis is today listed by the Catholic Church as a titular see.
The city was resettled by the Islamic refugees from Spain (Al-Andalus) in 1493 on the site of the ancient settlement.
Under Ottoman rule, Derna was initially under the governor at Tripoli, but shortly after 1711 it fell under the Karamanli sultanate, until 1835 when it became a dependency of the autonomous sanjak of Benghazi, essentially Cyrenaica, which was governed directly from Constantinople. This in turn, in 1875, became the vilayet of Cyrenaica. In the 1850s it had an estimated 4,500 inhabitants, who lived by agriculture, fishing and the coastal trade.
The oldest mosque in Derna is Al-masjeed al-ateeq, or the "Old Mosque", restored by wali Mahmoud Karamanli in 1772, vaulted with 42 small cupolas. This kind of vault was in use due to lack of some materials, like timber or stone in the region of Cyrenaica. There is another mosque, named Masjeed az-zawiyah, built in 1846, more strictly curved in the side of a hill.
The French admiral Gantheaume landed at Derna in June 1800 in an attempt to reinforce Napoleon in Egypt by bringing troops overland, but was rebuffed by the local garrison.
Derna was the location of the 1805 Battle of Derne, in which forces under U.S. Lieutenant and former Consul to Tripoli William Eaton—who had marched 500 miles (800 km) across the Libyan Desert from Alexandria—captured the city as part of the First Barbary War.
On 16 October 1911 Italian troops occupied Derna during the Italo-Turkish War.
On 30 January 1941, during the Second World War, Australian troops captured Derna from the Italians in the North African Campaign. On 6 April 1941, German forces retook the city from the British, and on 15 November 1942, British forces recaptured it.
In 2007, American troops in Iraq uncovered a list of foreign fighters for the Iraqi insurgency. Of the 112 Libyans on the list, 52 had come from Derna. Derna has the reputation of being the most fundamentalist Muslim city in Libya.
Following mass protests on 18 February 2011, the city came under the control of the National Transitional Council, breaking from the Libyan government. The city was never retaken before Gaddafi's ouster from Tripoli and the establishment of a new government. In October 2014, local militants affiliated with the Islamic Youth Shura Council publicly pledged allegiance to Abu Bakr al-Baghdadi, the leader of the Islamic State of Iraq and the Levant (ISIL). In November 2014, al-Baghdadi released an audio-recording accepting the pledge of allegiance and announced the expansion of his group.
Derna is located at the eastern end of the Jebel Akhdar, one of the rarest forested areas in Libya, given that Libya has one of the lowest forested lands ratio on earth, which it makes a mere 0.1% of the total country due to its arid climate. However, Derna is in proximity of the fertile upland area of the eastern Libya, which is the wettest region of Libya (600 mm).
Derna is linked with Shahhat by two roads, the inner one running through Al Qubah is part of the Libyan Coastal Highway and the coastal one running through Susa and Ras al Helal.
Derna features a hot semi-arid climate (Köppen climate classification BSh); the annual precipitation is around 252 mm.
In winter, the city's average temperature ranges between 9 and 20 Celsius. The modest annual precipitations fall between October and March. Summers are quite long and temperature highs average well above 27 Celsius between June and October.
Derna is a city that has three main squares: the most popular square is the Maydan Assahabah. This square was always used for mass demonstrations against Libyan President Muammar Gaddafi. The city is also a tourist hub, due to its wonderful old city (the medina), which is home to Islamic architecture. The Medina consists of a mosque, church, synagogue, many small streets, and old souqs. Derna is also a city that consists of different streets and various neighborhoods, such as Downtown (Wast Il Blaad), Al Ikweih, Al Mighar, Assahel Ashargi, Al Wadi, Bab Tobruq, Al Fitayih, and Bab Shaiha.
Old Medina, Dark Souq, Sahhaba Graveyard, Attiq Mosque (42 Domes), Souq al Kharraza, Souq al Farda and Khidra, Piazza Hamra, Piazza Derna, Maydan Al Sahhaba, Jewish Synagogue, Byzantine Church, Catholic Church, Ras Tin Beach, Piazza Attair, Ibrahim Istaa Omar, Derna Valley, Derna Waterfall, Finar Avenue, Zangat Al Bahr (Bahr Street), Omar Faiek Shennib Street, Zangat Al Hmar (Hmar Street).
Derna is home to four football clubs: Darnis, Al Afriqi, Al Shallal and Nusoor Martouba. Darnis is the most successful and popular club in the city. The biggest rivals in the city are Darnis and Al Afriqi which have a long and great history of classic rivalry.