Colin P. Clarke, a political scientist at the RAND Corporation and an associate fellow at the International Centre for Counter-Terrorism (ICCT)-The Hague. Follow him on Twitter @ColinPClarke.

With the Islamic State (IS) ousted from its Raqqa headquarters, it may seem inevitable that its caliphate is coming to an end. But even as the group’s state-building project is essentially defunct, it remains a dangerous clandestine terrorist network with transnational connections and the ability to use parts of Syria as a base to launch attacks against the West.

In some areas of Syria, the U.S. and its allies are in a race against time to beat the regime to specific locales throughout the country, ostensibly to consolidate territorial gains and prevent a power vacuum, but also to prevent Iran from controlling the corridor between Tehran and Damascus. Denying territory to Syria’s Assad regime also prevents it from gaining critical leverage in future political negotiations.

And while Raqqa has been retaken, further complications await the U.S.-led coalition. It remains unclear who or what will provide security and governance in Raqqa, which was liberated by a U.S.-backed militia comprised of both Syrian Arabs and Kurds known as the Syrian Democratic Forces. The local population is predominantly made up of Syrian Arabs, many of whom are fearful that Kurdish militias will stay—one occupier seemingly replaced by another. Local fears were not lessened when conquering troops unveiled a massive banner of Abdullah Ocalan, the leader of the Kurdistan Workers’ Party (PKK), a designated terrorist group with ties to the People’s Protection Units (YPG), a militia fighting with the Syrian Democratic Forces.

Additionally, fighters loyal to IS remain throughout eastern Syria, including around Deir Ezzor and Mayadeen. These cities could prove to be difficult places from which to dislodge fighters, particularly if militants continue to operate clandestinely until the group is powerful enough to regroup along the Euphrates River Valley, where some remnants of the group still control an estimated 4,000 square miles of territory.

It may be difficult for the United States to keep its allies interested after the caliphate has collapsed. The Islamic State still has between 6,000 and 10,000 fighters between Iraq and Syria. In addition, myriad violent non-state actors, including al-Qaeda’s Syrian affiliate Tahrir al-Sham, remain active throughout Syria. 

It is now time for the U.S.-led Coalition to figure out what its next counterterrorism steps should be, even as it continues to work toward stabilizing the country and navigating the path toward a political settlement with the other major powers involved—Iran, Turkey, Saudi Arabia, and Russia, to name a few. Though the Syrian civil war is far from over, achieving a negotiated political settlement is a necessary step in limiting the ability of IS to regroup and plan attacks from ungoverned swaths of the country.