Analysis: As ISIL is squeezed in Iraq and Syria, Libya has increasingly become a strategic alternative ground.
The recent US air strike on a building in the western Libyan city of Sabrata, which killed more than 40 suspected Islamic State of Iraq and the Levant (ISIL) fighters, highlights the growing expansion and danger of the group in Libya.
As ISIL continues to be squeezed in Iraq and Syria, Libya is increasingly becoming a strategic alternative ground. Another US air strike late last year in eastern Libya also reportedly killed Abu Nabil al-Anbari, a veteran Iraqi military officer believed to have been sent to Libya to organise and lead the group there.
But how did ISIL come to Libya in the first place?
The group gained its first foothold in 2014 in the eastern city of Derna, about 300km west of the Egyptian border. A number of young Libyan fighters who were once members of the al-Battar brigade, which fought against the regime of Syrian President Bashar al-Assad, became radicalised in an ISIL unit in Syria and were later sent back to Derna to establish an ISIL base there.
In June 2015, a local revolutionary force called the Abu Salim Martyrs Brigade began an operation to eradicate ISIL from the city, supported by local residents of Derna. Many ISIL fighters were killed or captured, while the remnants were quickly pushed out into the surrounding outskirts and mountains.
Benghazi, Libya's second-largest city, was the next to experience ISIL's emerging presence. Since the 2011 uprising, Benghazi has been home to a number of different groups vying for control, including Ansar al-Sharia, al-Qaeda and a number of other revolutionary brigades that formed a coalition called the Benghazi Revolutionaries' Shura Council (BRSC).
The coalition was created in response to an "anti-terrorism" military operation launched in May 2014 by General Khalifa Haftar. As fighting continued between Haftar's forces and BRSC fighters, foreign ISIL fighters increasingly flowed into Benghazi.
Many members of Ansar al-Sharia and al-Qaeda have since broken away from the BRSC and pledged allegiance to ISIL, which has become the city's dominant force, taking over entire districts such as Leithi and Gwarsha.
But after being ousted from Derna, ISIL also stands to lose its presence in Benghazi, leaving Sirte as its only remaining stronghold in Libya.
The coastal city of Sirte, about 450km east of Tripoli, is the hometown of former leader Muammar Gaddafi's tribe. Since the 2011 uprising, residents of Sirte have felt angry and marginalised—especially those members of Gaddafi's tribe whose family members were killed and whose homes were ransacked.
ISIL has exploited these sentiments, and the group is believed to have recruited some of Gaddafi's tribesmen and former army officers, who have become sympathetic to ISIL as they seek revenge against the new Libyan state.
Both ISIL and Gaddafi loyalists share the belief that the new political leaders in Libya are "agents of the West" brought to power by NATO. Sirte has become the first stronghold that ISIL totally controls outside of Iraq and Syria, and it is reportedly home to the group's strongest presence within Libya.
Sirte is also geographically significant, with a seaport offering access to southern Europe across the Mediterranean Sea. A top ISIL leader has been quoted as threatening to use Libya's proximity to attack Europe's security and disrupt its economy.
ISIL has been rapidly expanding and growing in Libya, and its ability to carry out major deadly attacks has been demonstrated on more than one occasion. In February 2015, ISIL released a propaganda video showing the beheadings of 21 Egyptian Christians on what was believed to be a beach in Sirte.
ISIL has also claimed responsibility for a suicide bombing against the famous luxury Corinthia Hotel in the capital Tripoli, a suicide bombing targeting the main western gate in the city of Misrata, and another bombing targeting a police training facility in Zliten that killed more than 60 people.
Although ISIL has yet to gain any ground in the capital Tripoli, there are reports of numerous sleeper cells within the city. Security forces in the capital have made several arrests of suspected ISIL members and recruiters, mainly non-Libyans of Arab origin and eight Tunisian nationals who were recently deported.
Sabrata, just 70km from the Tunisian border, is believed to be used by ISIL as a transit post for foreign recruits, mostly from Tunisia. Here, they receive false identity documents that allow them to move on to other areas of Libya.
Tunisia has been a fertile recruiting ground for ISIL, possibly because of its high level of youth unemployment. ISIL's new recruits are reportedly provided with monthly salaries in the range of $1,000, compared with the average Tunisian salary of around 500 Tunisian dinars ($246).
Having a base in Libya also provides ISIL with the potential to expand into sub-Saharan Africa, widening its reach to potential recruits.
The United Nations has been pressing the opposing Libyan sides to implement a political agreement signed in Morocco in December and install a new government of national accord. Once this government has been formed and assumes office in the capital, Tripoli, it is then expected to officially request the international community to lift an arms embargo and provide assistance to take on ISIL.
This is most likely to come in the form of targeted air strikes and intelligence sharing, in a coordinated campaign with Libyan forces on the ground. It is unlikely that any Western or foreign ground troops would be involved in the war on ISIL in Libya, as the prospect has been widely rejected by the Libyan public.
At this point, ISIL controls far less territory in Libya than in Iraq and Syria, and is yet to gain any access to Libyan oil resources. The number of ISIL fighters in Libya is also far fewer, estimated at just a few thousand, according to US sources.
The events in Derna that saw local forces expel ISIL from within the city offer hope that ISIL can be contained and eventually eradicated from Libya, provided that the country can be swiftly reunited under one government and unified sovereign institutions.
A unified Libya assisted by the international community would be able to swiftly retake ISIL positions in the country, with the final showdown potentially being the battle of Sirte. Similar to the demise of Gaddafi, Sirte could be the location of ISIL's final days in Libya.
Guma El-Gamaty, Al Jazeera