US-backed Syrian Democratic Forces say they have "totally eliminated" Islamic State in Syria.
The SDF made the announcement as it declared the battle against the insurgents in the final IS stronghold of Baghouz in the east of the country was over.
It has been battling the last remnants of IS, also known as Daesh, in the border town near Iraq for weeks as the jihadists have been using civilians as human shields.
The Kurdish-led Syrian Democratic Forces have now claimed "all territory in Syria is now clear of IS fighters".
SDF spokesman Mustafa Bali tweeted: "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. #SDFDefeatedISIS."
Theresa May credited the "immense courage" of the UK armed forces and their allies, while Foreign Secretary Jeremy Hunt vowed Britain will "remain resolute" in its commitment against IS and its "poisonous ideology".
The prime minister tweeted: "The liberation of the last Daesh-held territory wouldn't have been possible without the immense courage of UK military and our allies.
"We will continue to do what is necessary to protect the British people, our Allies and partners from the threat Daesh poses."
Thousands of civilians, including families of IS fighters, have been fleeing Baghouz in recent weeks amid intense fighting, and are now being held in camps.
At its height, the militant group's caliphate, which it declared in 2014, stretched across a third of Syria and Iraq.
However, despite the SDF's victory, IS insurgents still remain a threat.
Some are hiding out in Syria's remote central desert, and in Iraqi cities they have gone underground, carrying out shootings and kidnappings.
The US believes the group's leader Abu Bakr al Baghdadi, who declared the caliphate five years ago in Mosul, is in Iraq.
On the liberation of the region, US President Donald Trump said in a statement: "I am pleased to announce that, together with our partners in the Global Coalition to Defeat ISIS, including the Iraqi Security Forces and the Syrian Democratic Forces, the United States has liberated all ISIS-controlled territory in Syria and Iraq.
"While on occasion these cowards will resurface, they have lost all prestige and power. They are losers and will always be losers."
'An apocalyptic wasteland' - Sky's Alex Rossi reports from Baghouz
The road into the Islamic State's final stronghold is a wasteland.
Twisted metal and shredded tents are all that's left of a terror group that once boasted of controlling urban centres like Mosul and Raqqa.
As we enter Baghouz, a small town split in two by the Euphrates river, our convoy is stopped.
A hill, that wraps around the outskirts of what now looks like a junkyard, is the setting for IS's final stand.
This time there is no opportunity for the extremists to publish high-definition video propaganda, no defiant messages on social media - just the intermittent sound of gunfire as Syrian Democratic Forces clear the last remaining pocket of resistance.
Soldiers move us back while the final blow is delivered.
Eventually the guns fall silent and we journey further into this dark, apocalyptic hellscape.
The corpses of two men lay rotting in the pallid spring sun - the stench is everywhere; blown on the desert wind.
For the Kurdish forces this victory is traced with sadness. Many died as martyrs in what was a global fight. The future of their people is also far from secure.
It is why the declaration of victory is a surreal moment. An understated ceremony on a rooftop overlooking the Euphrates river. The commander, who led the fight, confirming IS rule is over.
But the defeat of IS - as a territorial entity - has been brutal and devastating for millions across this region. It is a journey through destroyed communities and broken futures.
Town after battered town tells a story of years of fighting to break the group's poisonous stranglehold on Iraq and Syria.
What comes next will depend on whether there can be effective government and how these regions are reconstructed.
Remember: IS's warped ideology found fertile ground in the chaos of war and sectarian and economic grievance.
If these fundamental issues are not addressed, and eventually fixed, the group's comeback could be even more rapid, and vicious, than its initial ascendance.
And, while the victory is complete, there are still areas that need searching for IS fighters who've gone into hiding as sleeper cells.
More often than not the soldiers tasked with the duty are shooting at shadows.
The ghosts of Islamic State will haunt these places for a long time to come.
There is no doubt that the desperation and the inglorious final stand of the caliphate is hugely damaging to its brand.
But even with its flag and fighters laying in tatters on the battlefield of Baghouz, it still has the resources to rise up from this and strike again.