The Kurdish-led Syrian Democratic Forces (SDF) says the Islamic State group's five-year "caliphate" is over after the militants' defeat in Syria.
SDF fighters have been raising victory flags in Baghuz, the last stronghold of the jihadist group.
But as celebrations began there were also warnings that IS remains a major global security threat.
The jihadists retain a presence in the region and are active in countries from Nigeria to the Philippines.
At its height, IS controlled 88,000 square kilometres of land stretching across Syria and Iraq.
After five years of fierce battles, though, local forces backed by world powers left IS with all but a few hundred square metres near Syria's border with Iraq.
How did the final battle unfold?
The SDF alliance began its final assault on IS at the start of March, with the remaining militants holed up in the village of Baghuz in eastern Syria.
The alliance was forced to slow its offensive after it emerged that a large number of civilians were also there, sheltering in buildings, tents and tunnels.
Thousands of women and children, foreign nationals among them, fled the fighting and severe shortages to make their way to SDF-run camps for displaced persons.
Many IS fighters have also abandoned Baghuz, but those who stayed put up fierce resistance, deploying suicide bombers and car bombs.
"Syrian Democratic Forces declare total elimination of so-called caliphate and 100% territorial defeat of Isis [the IS group]," Mustafa Bali, the head of the SDF media office, tweeted on Saturday.
Confirming the victory, SDF General Mazloum Kobani said the forces would continue operations against IS sleeper cells, which he said were "a great threat to our region and the whole world".
He called on the Syrian government, which has vowed to retake all of the country, to recognise autonomous areas under SDF control.
The US envoy to the coalition to defeat IS, William Roebuck, said the news was a "critical milestone", but added that IS remains a threat "in the region, to the United States and our allies".
French President Emmanuel Macron welcomed the SDF's announcement, saying a "major danger for our country has been eliminated".
UK Prime Minister Theresa May also welcomed the news and vowed to do "what is necessary" to protect British people and others from the threat of IS.
Why are there still concerns about IS?
IS grew out of al-Qaeda in Iraq in the aftermath of the US-led invasion of Iraq in 2003.
It joined the rebellion against Syrian President Bashar al-Assad in 2011. By 2014 it had seized swathes of land in both countries and proclaimed a "caliphate".
IS once imposed its rule on almost eight million people, and generated billions of dollars from oil, extortion, robbery and kidnapping, using its territory as a platform to launch foreign attacks.
The fall of Baghuz is a major moment in the campaign against IS. The Iraqi government declared victory against the militants in 2017.
But the group is far from defeated. US officials believe IS may have 15,000 to 20,000 armed adherents active in the region, many of them in sleeper cells, and that it will return to its insurgent roots while attempting to rebuild.
Even as its defeat in Baghuz was imminent, IS released a defiant audio recording purportedly from its spokesman Abu Hassan al-Muhajir, asserting that the caliphate was not finished.
The location of the group's overall leader, Abu Bakr al-Baghdadi, is not known. But he has avoided being captured or killed, despite having fewer places to hide.