WASHINGTON — The fight to expel the Islamic State from its last shard of territory in Syria may be over. But the United States and its partners still face significant battles against the terrorist group, its affiliates and other networks that are less formally aligned with it elsewhere, in Afghanistan, West Africa and the Philippines.

Even before an American-backed Kurdish and Arab militia ousted the last extremist fighters from the eastern Syrian village of Baghuz on Saturday, the Islamic State had shifted gears. The organization that once staked out a self-proclaimed caliphate across Iraq and Syria has now metastasized into a more traditional terrorist group — an atomized, clandestine network of cells engaged in guerrilla attacks, bombings and targeted assassinations.

[For more stories about the experiences and costs of war, sign up for the weekly At War newsletter.]

Thousands of American troops are helping the Afghan Army and security forces combat the Islamic State and other terrorist groups in Afghanistan. Armed American drones are hunting Islamic State cells in Libya. And American forces are advising and providing intelligence to local troops fighting the Islamic State in Burkina Faso and in the Philippines.

Thousands of Islamic State fighters are also still at large in Iraq and Syria, biding their time to rearm and regroup to strike the same regions again. Many of them slipped out or surrendered when the final wave of civilians fled Baghuz, American commanders and intelligence analysts said.