An assault this week on a Tunisian border town by infiltrators from Libya highlights the growing threat to North Africa by the Islamic State, which has used years of political instability in Libya to establish a new sanctuary in Europe’s backyard.

Libya descended into chaos after U.S.-backed rebels overthrew Libyan strongman Moammar Gadhafi in 2011. Without an effective administration to succeed Gadhafi, local militias seized power in their areas, turning the country into a patchwork of warring fiefdoms.

That has opened the door to the Islamic State. Nick Witney, a senior fellow with the European Council on Foreign Relations, said it appeared the Islamic State’s goal was to establish a “reserve position” in Libya because it is being increasingly squeezed by U.S. and Russian bombing in Syria and Iraq, where it established a self-styled “caliphate” in 2014.

A robust Islamic State presence in Libya is now putting pressure on Tunisia, which had been the success story of the Arab Spring.

“The challenges have continued to grow (in Libya) because of ISIS and its brand of terrorism to threaten places like Tunisia,” Africa Command’s Gen. David Rodriguez told a Senate committee Tuesday, using an acronym for Islamic State.

Monday’s attack in Ben Guerdane, Tunisia, about 20 miles from the Libyan border, shows that the threat is more than hypothetical.

About 50 heavily armed attackers stormed the military barracks and a police station, triggering an hourslong gunbattle that left at least 36 attackers dead, along with a dozen members of the Tunisian security forces and seven civilians.

“The Islamic State attack into the heart of the southeastern Tunisian city of Ben Guerdane opens up a new zone of conflict,” said a report released on Wednesday by the Brussels-based International Crisis Group.

Faced with a growing regional threat from Libya, the U.S. military has begun to focus attention on the oil-rich country. Last month, U.S. warplanes bombed a jihadist training camp at Sabratha, a town in Libya close to the Tunisian border, killing about 40 alleged militants.

Few details have emerged but U.S. military officials have acknowledged that small numbers of special operations forces have been coordinating with Libya’s army. There is evidence of French and British special operations forces in Libya as well.

At the same time, the Pentagon is reportedly preparing for a more robust military role.

On Tuesday, The New York Times reported the Pentagon presented the White House with a detailed plan for extensive airstrikes in Libya aimed at delivering a crippling blow to the Islamic State.

But the newspaper said the White House has shelved the plan for the time being while the Obama administration steps up a diplomatic initiative to help the Libyans form a government of national unity capable of confronting the Islamic State.

Some analysts fear that without diplomatic progress, a major air operation in Libya might serve only to repeat the mistakes of the Iraq war — drawing the West deeper into conflict.

“(The Islamic State) tend to be a symptom. The underlying problem is state collapse in Libya, just as it was in Syria two years ago,” said Witney, who used to head the European Union’s defense agency.

Rather than focusing on a military response, Witney said, the United States and its European allies should work to resolve the internal problems of Libya, which has two rival governments — the Western-backed one based in the eastern town of Tobruk, and another that controls the capital, Tripoli.

“There’s a risk ... Europeans, the French in particular, will follow the U.S. down the mistaken path of a European war on terror,” Witney said. “But a new bombing campaign or involvement on the ground would be a major mistake by the West.”

But progress in resolving Libya’s political problems has been painfully slow. In the meantime the threat to Tunisia is growing.

The tiny country launched the Arab Spring in December 2010 with a revolt that toppled longtime strongman Zine al-Abidine Ben Ali.

While the Arab Spring brought more repression in Egypt and war to Yemen and Syria, the Ben Ali regime was replaced by a stable, democratic government.

Five years later, however, Tunisia’s democratic experience is threatened by economic challenges, including high unemployment and social unrest.

Three deadly terrorist attacks on tourists in the past year have left its once-booming tourist industry facing collapse.

“Tunisia has a lot of home-grown problems, which make it vulnerable” to infiltration by the Islamic State, said Rafik Mezran, senior fellow in the Atlantic Council’s Rafik Hariri Center for the Middle East.

The Islamic State is “a very shrewd organization ... they play on local grievances, aligning themselves with local tribes to establish a foothold,” Mezran said.

The effects of the economic downturn in Tunisia have been most intense in areas near the Libyan border, such as Ben Guerdane. Mezran said it was likely that the Ben Guerdane attackers had some support among the local, impoverished population.

He noted that many of the Islamic State’s fighters inside Libya come from Tunisia.

“It’s still unclear what the objective of the attack was,” Mezran said. “It’s somewhere on the border between a terrorist attack and the attempt to create a local insurrection and take over control of the city.”

Witney, of the European Council on Foreign Relations, said Tunisian security forces performed well in repulsing the attack and that providing them with advisers and more equipment was a better option that an all-out air campaign.

For AFRICOM, a series of training efforts is aimed at building up the resiliency of Tunisia’s armed forces as it faces growing unrest. Those efforts include counterterrorism training, developing Tunisian air power and assistance in intelligence and border security capabilities, Rodriguez said.

“We are also assisting Tunisia in installing an electronic surveillance system along key portions of the border with Libya to help stem the illegal flow of people, arms, and contraband,” Rodriguez said in testimony to Congress.

There are also signs, however, that the Europeans are becoming more active in Libya, fearing the threat to Europe’s security posed by a growing Islamic State presence in North Africa.

On Wednesday, the private security firm Stratfor said satellite imagery had confirmed the arrival of French special operations forces to Benina air base near Benghazi, in eastern Libya. The base was rumored to host as many as 180 French soldiers, Stratfor said.

“Until a clearer prospective political solution emerges, U.S., British, French and Italian military forces have decided to work incrementally in both western and eastern Libya to fight the Islamic State,” Stratfor said. “In western Libya, U.S. and British forces are reportedly working with militias from Misrata, while in the east, French forces reportedly work near Benghazi.”

An AFRICOM spokesman declined to detail the U.S. military mission in Libya. “With regard to the SOF personnel, I can’t address the subject due to operational security concerns,” Lt. Cmdr. Anthony Falvo said. “But I’ll tell you that we are committed to partnering with Libyans and local authorities on counterterrorism measures in Libya.”

Stars and Stripes reporter John Vandiver contributed to this report.

lekic.slobodan@stripes.com