Eastern Syria (CNN) ISIS has lost its final stronghold in Syria, the Syrian Democratic Forces announced Saturday, bringing an end to the so-called caliphate declared by the terrorist group in 2014.

The coalition of Kurdish and Arab soldiers backed by US, British and French special forces said it defeated ISIS and fully liberated Baghouz in eastern Syria.

"Syrian Democratic Forces declare total elimination of so-called caliphate and 100% territorial defeat of ISIS. On this unique day, we commemorate thousands of martyrs whose efforts made the victory possible," tweeted Mustafa Bali, head of the SDF press office.

In a paper statement issued at a formal ceremony to mark ISIS' defeat, the SDF said it had lost 11,000 "forces, leaders and fighters" battling the militant group. But it vowed to continue the fight against any elements of ISIS sleeper cells, which "still pose a great danger on our region and the whole world."

Ending weeks of combat, the US-backed Syrian forces raised a yellow flag atop a building in the town as they celebrated the victory over ISIS.

At its peak, ISIS controlled a huge stretch of territory stretching from western Syria to the outskirts of the Iraqi capital of Baghdad. But the final battle took place in the past several weeks around the small and otherwise unremarkable Syrian town of Baghouz, on the banks of the Euphrates River.

For weeks, US-led coalition airstrikes had pummeled parts of the town while fighters from the Syrian Democratic Forces (SDF) pushed forward on the ground.

The final battle played out on a hillside near Baghouz. On Saturday morning, inside what was the group's final enclave, all that remained was a junkyard of wrecked cars, tattered tents, ditches and dead bodies.

The victory has been hailed by British Prime Minister Theresa May, French President Emmanuel Macron and other members of the global coalition fighting ISIS.

"We must not lose sight of the threat Daesh [ISIS] poses," May said, adding that her government "remains committed to eradicating their poisonous ideology."

Before the offensive started, SDF officials estimated that 1,500 civilians and 500 ISIS fighters remained, but as the assault got under way it became clear that the actual number was much higher. The final phase of the battle was delayed to allow thousands more civilians -- along with foreign ISIS supporters -- out of of the besieged town.

The militants who mounted the last stand in Baghouz included some of the most battle-hardened and experienced personnel remaining in ISIS, and the wives and children of the fighters were used as human shields.

SDF commanders told CNN that its fighters had faced fierce resistance from the terror group, which slowed the offensive with snipers, improvised explosive devices improvised and heat-seeking missiles. The militants had also dug a network of underground tunnels that allowed them to move from house to house undetected.

Smoke rises above Baghouz during the final battle to retake the town.

Fighters from the Syrian Democratic Forces returning from the frontline in Baghouz flash the "V" for victory sign.

The capture of Baghouz comes nearly three months after US President Donald Trump surprised America's allies -- not least SDF forces on the ground -- by declaring that ISIS had been defeated in Syria and announcing that US troops would be rapidly withdrawn from the country. The decision triggered the resignations of Defense Secretary James Mattis and the senior State Department official in charge of the anti-ISIS campaign.

The developments also come more than four years after the group's elusive leader, Abu Bakr al-Baghdadi, announced the creation of a caliphate from the pulpit of the al-Nuri mosque in the Iraqi city of Mosul.

At the group's height, 7.7 million people were estimated to live under ISIS rule, according to Operation Inherent Resolve (CJTF-OIR), the official name for the coalition fighting ISIS. Many of those people paid taxes, fees and fines to ISIS, which made up a large portion of the group's income.

In the years since, the group's annual revenue more than halved: from up to $1.9 billion in 2014 to a maximum of $870 million in 2016, according to a recent report by the International Centre for the Study of Radicalisation and Political Violence (ICSR) at King's College London.

Men suspected of being ISIS fighters wait to be searched by SDF members after leaving Baghouz.

Despite the loss of territory, and funds, a UN-monitoring committee estimated in July 2018 that ISIS membership in Iraq and Syria was still between 20,000 and 30,000.

Altogether, at least 41,490 international citizens traveled to Syria and Iraq to join ISIS, according to ICSR. And foreign fighters continued to arrive, undeterred -- the coalition recently estimated that about 50 were arriving each month.

Lina Khatib, the head of the Middle East and North Africa programme at Chatham House, a UK-based think tank for international affairs, says ISIS will revert to its insurgent roots as it moves underground, using the territorial loss as a call to arms among its network of supporters.

"The group itself has not been eradicated," Khatib told CNN. "The ideology of ISIS is still very much at large."

Has the battle against ISIS really been won?

ISIS may have lost its last sliver of terrain in Syria, but the group is currently waging a fresh guerrilla campaign in far-flung territories of northern Iraq . And its black flag is still flown by affiliates in other corners of the globe, including Nigeria, Libya, Egypt's Sinai Peninsula, Afghanistan and the Philippines.

The US commander leading the war on ISIS said in February that he disagreed with Trump's decision late last year to withdraw troops from Syria, saying the terror group was far from defeated.

Joseph Votel, the top American general in the Middle East, warned: "(The caliphate) still has leaders, still has fighters, it still has facilitators, it still has resources, so our continued military pressure is necessary to continue to go after that network."

Civilians evacuated from the embattled holdout of Baghouz wait to be screened by SDF fighters.

In mid-February, a new Pentagon report also appeared to reinforce the notion that total victory over ISIS was not on the horizon.

The report, the first of its kind since Trump announced plans to pull all troops from Syria, also says "ISIS remains an active insurgent group in both Iraq and Syria."

"ISIS is regenerating key functions and capabilities more quickly in Iraq than in Syria, but absent sustained [counterterrorism] pressure, ISIS could likely resurge in Syria within six to twelve months and regain limited territory," the report said.

Just over a year after the Iraqi military declared victory over ISIS, militants there are waging a fresh guerrilla campaign from their base in far-flung northern territories -- launching targeted assassinations, looting villages, planting roadside bombs and training a new "strike force," an Iraqi intelligence source told CNN.

In the vast desert badlands near the Hamrin mountain range, residents remain at the mercy of ISIS "gangs" who rule the night. They know the region well, having embedded themselves here back when they were known as the Islamic State of Iraq, and as al Qaeda in Iraq before that.

"The risk of re-emergence is very real. We always need to think about what happened with al Qaeda in Iraq about a decade ago when it was largely defeated. Reports at the time said there were only about 700 members of the group left. But a few years later we saw ISIS emerge," Khatib said.

"We need a long-term strategy, a 10-year strategy ... in order to prevent an enabling environment that could lead to their re-emergence."