TUNIS (Reuters) - Islamic State has lost senior figures in an unsuccessful seven-month battle to defend its coastal stronghold in Libya, but there are already signs it will try to fight back through sleeper cells and desert brigades.

A fighter of Libyan forces allied with the U.N.-backed government waving a Libyan flag flashes victory sign as he stands atop the ruins of a house after forces finished clearing Ghiza Bahriya, the final district of the former Islamic State stronghold of Sirte, Libya December 6, 2016. REUTERS/Hani Amara

Libyan officials say hundreds of Islamic State militants may have escaped before the start of the battle for Sirte in May or during its early stages.

That has prompted fears of a counter-attack or insurgent campaign that could enable the militants to show they are still in business despite the rout, a heavy blow for a group that is also under intense military pressure in its core territory of Iraq and Syria.

Some cells have already been active. Islamic State is thought to be behind at least two dozen attacks or attempted attacks to the south and west of Sirte since August, said Heni Nsaibia of Menastream, a risk consultancy that monitors jihadist activity in the region.

Before May, IS was thought to have several thousand fighters stationed in Sirte - estimates of the exact number varied widely. Both leadership and rank and file had a heavy foreign presence, drawing on recruits from north and sub-Saharan Africa, according to Sirte residents and security officials in Misrata, the city that led the campaign to retake the jihadist stronghold.

Much of that force has likely been wiped out over the past seven months, with dozens killed on both sides during the heaviest days of fighting. Islamic State was targeted by nearly 500 U.S. air strikes since Aug. 1.

Local officials say a number of high-level Libyan figures perished, including preacher and commander Hassan al-Karami, and senior official Abu Walid al-Ferjani.

Foreign commanders have also died, according to messages of mourning posted on social media accounts close to the militant group, though it is unclear how far up the hierarchy they were or how important to the group’s future operations, said Marco Arnaboldi, a researcher of political Islam specializing on Libya.

FEW PRISONERS

Misratan officials refused to comment on reports of Islamic State militants being killed after capture, but fighters and commanders say they took few, if any, prisoners.

Ibrahim Baitulmal, head of Misrata’s military council, estimated that 1,700 jihadists’ bodies had been recovered during the campaign, adding that the number killed would have been higher since the militants retrieved some of their own dead.

He said among those killed in the final days of the battle in Sirte was Abu Habib Jazrawi, a Saudi who is thought to have taken the name Abdul Qadr al-Najdi before being named as Islamic State’s leader in Libya in March.

Islamic State has not announced his death. Regional media reported that Najdi was replaced in September by a Tunisian, Jalaludin Al-Tunsi, possibly appointed to carry on the fight outside Sirte. “He’s one of the leaders who is going to prepare the next wave of Islamic State from south of the city,” said Arnaboldi.

The jihadist group has made no secret of its plans to continue the fight, in a country still roiled by the turmoil it exploited in the past. In August, the new leader of its east Libyan branch, Abu Musab al-Farouq, said high-level figures who had escaped from Sirte were helping it regroup not far away.

In late October the head of the west Libyan branch, Abu Hudhayfah al-Muhajir, acknowledged that the group had been suffering, but said it would continue its campaign for “conquest and empowerment” and was still attracting a steady flow of foreign fighters.

“Most of our people in Sirte have moved to neighbouring areas six months ago - and are still moving - during which they experienced the worst,” he said in an interview with Al Naba, an Islamic State newsletter.

“The mujahideen in the Libyan provinces are still well ... Their security detachments are still spread in all the cities and the areas, and their brigades move in the east and west of the desert.”