An Egyptian F-16 fighter prepares to take off to carry out an airstrike against militants loyal to the Islamic State in Darna in eastern Libya, from a base in an undisclosed location, on Feb. 15. (Egyptian military via EPA)

The Egyptian military conducted a series of airstrikes Monday on the Libyan coastal city of Darna, where jihadists affiliated with the Islamic State hold sway. The attacks were in retaliation for the purported beheading of 21 Egyptian Coptic Christian hostages on a Libyan beach by Islamic State-linked militants. A video depicting the grisly act was uploaded to an Islamic State-sympathetic Web site on Sunday, sparking Egyptian ire.

The response from Cairo was not unlike that of Jordan earlier this month, after the Islamic State had executed a Jordanian fighter pilot in its custody by burning him alive in a cage. Public furor and anger prompted waves of strikes on Islamic State positions in Syria. A similar impulse was on display this week. "Let those near and far know that the Egyptians have a shield that protects and preserves the security of the country, and a sword that eradicates terrorism," read a statement from the Egyptian military Monday.

The actions mark the widening war against the Islamic State, which controls territory in Iraq and Syria and now boasts offshoots in places as far-flung as Afghanistan and Libya. The security crisis in the North African nation -- which is torn between two parallel governments and a constellation of feuding militias -- has made the Islamic State's rise here all the more troubling.

Darna appears to be one of the main hotbeds of jihadist activity. The city, less than 200 miles from the major eastern city of Benghazi, has a long history of militancy, dating back well before the fall of the dictatorial regime of Moammar Gaddafi in 2011. It was one of the biggest contributors to the ranks of the Libyan Islamic Fighting Group, once the Libyan faction of the mujahideen in Afghanistan combating the Soviet Union that later morphed into a suspected al-Qaeda affiliate and sent fighters to battle the U.S. occupation in Iraq. (According to CNN, no town in the Middle East contributed more combatants per capita to Iraq than Darna.)

The Gaddafi regime cracked down brutally on Islamists here in the 1990s; dozens of political prisoners from Darna were among the dead following the infamous 1996 massacre of some 1,200 people at Tripoli's Abu Salim prison. During the 2011 rebellion, Gaddafi pointed to the city as an example of the extremist forces marshaled against him, prompting anti-Gaddafi activists to put up signs around the town declaring "Yes to pluralism" and "No to [al-]Qaeda," according to the Guardian.

That hopeful narrative crumbled not long after Gaddafi's demise, as factions that had worked loosely together to bring down the regime struggled to co-exist in post-dictatorship Libya. Weak elected governments in Tripoli were unable to assert their authority outside the capital, and eventually, even within it. "In the lawless aftermath of Gaddafi’s fall, Darna was an inevitable hub for extremism," reported The Post's Abigail Hauslohner after a 2012 visit to the city.

Hundreds of Libyan fighters from Darna made their way to Syria to join the rebellion against Syrian President Bashar al-Assad; some entered the ranks of the Islamic State. Others returned.

Jihadist militancy deepened in parts of Libya. By 2012, Darna was effectively out of government hands and beholden to a number of armed Islamist groups, with differing agendas and affiliations. In August, a Darna-based group called the Shura Council for Islamic Youth carried out a grim public execution in a soccer stadium. The act led to international condemnation.

"This unlawful killing realizes the greatest fears of ordinary Libyans, who in parts of the country find themselves caught between ruthless armed groups and a failed state," said Hassiba Hadj Sahraoui, Amnesty International's Middle East and North Africa deputy director, in a news release at the time.

In October, it appeared that some members of the Shura Council swore fealty to the Islamic State and its leader, Abu Bakr al-Baghdadi. It's unclear to what extent the Islamic State's affiliates control Darna, but their ranks are believed to number in the hundreds, if not thousands, bolstered by the return of jihadists from Syria as well as an influx of recruits being trained in facilities in the nearby Green Mountains, according to CNN.

They have declared their new emirate "Barqa," a reference to the name given to this part of eastern Libya following the Arab conquest of the former Roman province of Cyrenaica in the 7th century.

The militants have carried out assassinations, abductions and are linked to a string of suicide attacks as turf wars between armed factions played out across the country. Political officials were shot in broad daylight; others were too intimidated to keep their posts. In November, three liberal activists in Darna were found beheaded.

Now, according to some reports, the Islamic State has emerged as Darna's biggest player. The city "today looks identical to Raqqa, the [Islamic State's] headquarters town in Syria," said Noman Benotman, a Libyan terror analyst, in an interview with CNN.

An Islamic State offshoot in Tripoli claimed responsibility for both the beheadings of the Egyptian hostages as well as a terror attack this year on a five-star hotel in Tripoli which killed 10 people, including a handful of foreigners. An Islamic State affiliate also claimed responsibility for a January assault on a Libyan army post in the country's south that led to the deaths of 14 soldiers.

Complicating the whole picture is the sheer mess of Libya's politics. An Islamist-backed government now sits in Tripoli after its allied militias -- grouped together in a coalition dubbed "Libya Dawn"-- chased out an earlier government recognized by the majority of the international community. The exiled politicians took up their seat in the port city of Tobruk, on the border with Egypt. The Tobruk government has the backing of Egypt, the U.A.E. and a handful of other governments eager to combat the rising Islamist forces.

The leading figure in the war against Libya Dawn is the mysterious rogue general Khalifa Hifter. In an interview with the New Yorker published this week, Hifter, who has been locked in battle with Islamist militias in Tripoli and Benghazi, vowed to take on the jihadists encamped in Darna. "We will use all the means at our disposal to exterminate them," said Hifter, who commands his own air force and is alleged to have ties to the CIA.

Darna, a drab, impoverished town, is perhaps a strange focal point of such a vast geopolitical struggle.

"It’s the emptiness here — there is a lot of time to waste," a politician from the city told The Post in 2012. "Most people feel like their lives are restricted, so they think only in terms of the front lines, death and jihad."