MANBIJ, Syria — Cities and towns across eastern Syria are overwhelmed by rubble. The militias that fought the Islamic State are digging tunnels to prepare for a possible battle against Turkey. A recent explosion in the city of Raqqa killed nine people.

The routing of the Islamic State from its final piece of territory in Syria last month was hailed as a milestone in the fight against the world’s most fearsome terrorist organization. But the territory it once ruled remains in shambles, insecure and its future uncertain.

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

Entire communities are destroyed, with little help to rebuild. A range of powers — the Syrian government, Turkey, Russia and militias backed by Iran — hope to fill the void left by the jihadists’ defeat. And the Islamic State isn’t even gone: while the bombings that killed at least 250 people in Sri Lanka last week demonstrated that its ideology continues to echo globally, in Syria thousands of its fighters have merely gone underground to launch attacks and plot their comeback.

“We are talking about a secret organization that is still operating,” said Redur Xelil, a senior official with the Syrian Democratic Forces, the Kurdish-led militia that the United States backed to fight the jihadists. “It has a network, means of communication and a central command.”