The battle for Tripoli between rival Libyan forces both championing the fight against "terrorism" has created a security vacuum, allowing the Daesh group a chance to re-emerge, analysts warn.
Libya expert Emad Badi says the fighting has given Daesh "the opportunity to reorganise, recruit and strike alliances with other groups (and organise attacks) to show they are still around.”
Militant groups capitalised on Libya's descent into chaos after the 2011 uprising that killed veteran dictator Moamer Qadhafi to establish a presence in the North African country.
Daesh had its main stronghold in Kadhafi's hometown of Sirte, east of Tripoli, until it was expelled from the Mediterranean coastal city in December 2016.
Shell casings are seen on the ground during a fight in Al Yarmouk, Tripoli, Libya. File Photo/Reuters
The group's demise came at the hands of forces loyal to the Tripoli-based internationally recognised Government of National Accord (GNA), especially fighters from the western city of Misrata.
Those fighters are among pro-GNA forces now battling the self-styled Libyan National Army of military strongman Khalifa Haftar who launched an assault on Tripoli on April 4.
Haftar has vowed to "cleanse" Libya of militants and presents himself as the country's saviour.
In 2017, he drove hardline militants out of second city Benghazi after a three-year battle and ousted militants from Derna, also in the east.
Then in January he launched an operation to "purge the south of terrorist and criminal groups" before setting his sights on Tripoli.
But despite being weakened, the militants still pose a threat in oil-rich Libya, where they were blamed for around 20 attacks last year.
And over the past week Daesh has carried out two deadly assaults targeting Haftar's forces -- on a training camp in the southern city of Sebha on May 4 that left nine dead and an attack Thursday in Ghodwa, also in the south, that killed two civilians.
Militants feeding on divisions
Instability has reigned over Libya since the 2011 uprising, with rival political and military forces vying for power and fighting for the country's oil wealth and cities.
Militant groups such as Daesh have fed on this chaos to grow, and divisions that persist as reflected by the battle for Tripoli only serve to bolster them, analysts say.
"The divisions give terrorists an unexpected opportunity to mobilise and reorganise," said Khaled Al Montasser, a professor of international studies who lectures at Libyan universities.
After losing Sirte and Derna, Daesh was weakened but not totally defeated as its fighters withdrew to the country's remote and vast desert in the south or infiltrated coastal communities.
The threat militants pose was highlighted in a statement Thursday by the GNA, which also blamed Haftar's offensive for giving groups like Daesh another chance to regroup.
"GNA forces continue to repel the Haftar militias but their attacks... destabilise our country and allow terrorist groups like Daesh to re-emerge," it said using an Arabic acronym for Daesh.
Karim Bitar, director of research at the French Institute for International and Strategic Affairs (FIISA), draws a parallel with Syria and Iraq, where Daesh built a "caliphate" after a lightning offensive in 2014.
"In Libya, as in Iraq and Syria before it, Daesh took advantage of a vacuum... and the collapse of the state's structures to anchor itself," he said.
"As long as Libya is divided and as long as the state's sovereign authority is not re-established across the country, there is a risk that Daesh will be able to regain ground," he said.
Agence France-Presse