The battle for Tripoli between rival Libyan forces both
championing the fight against "terrorism" has created a security
vacuum, allowing the ISIS group a chance to re-emerge, analysts warn.
Libya expert Emad Badi says the fighting has given ISIS "the opportunity to reorganize, recruit and strike alliances with other groups (and organise attacks) to show they are still around".
Jihadist groups capitalized on Libya's descent into chaos after the 2011 uprising that killed veteran dictator Moamer Kadhafi to establish a presence in the North African country.
ISIS 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.
The group's demise came at the hands of forces loyal to the Tripoli-based internationally recognized 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 jihadists and presents himself as the country's saviour.
In 2017, he drove hardline Islamists out of second city Benghazi after a three-year battle and ousted jihadists 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 jihadists still pose a threat in oil-rich Libya, where they were blamed for around 20 attacks last year.
And over the past week ISIS 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.
Jihadists 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.
Jihadist groups such as ISIS 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 mobilize and reorganise," said Khaled al-Montasser, a professor of international studies who lectures at Libyan universities.
After losing Sirte and Derna, ISIS 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 jihadists pose was highlighted in a statement Thursday by the GNA, which also blamed Haftar's offensive for giving groups like ISIS 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 ISIS.
Karim Bitar, director of research at the French Institute for International and Strategic Affairs, draws a parallel with Syria and Iraq, where ISIS built a "caliphate" after a lightning offensive in 2014.
"In Libya, as in Iraq and Syria before it, ISIS 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 ISIS will be able to regain ground," he said.