US-backed Syrian fighters are reported to have overrun an encampment that made up most of the last patch of territory held by the Islamic State group.
The Syrian Democratic Forces (SDF) alliance said militants refusing to surrender had pulled back to a sliver of land along the River Euphrates south of Baghuz, and that clashes continued.
Although it warned the battle was not over, some fighters began celebrating.
Baghuz’s fall would bring an end to the “caliphate” proclaimed by IS in 2014.
The jihadist group once controlled 88,000 sq km (34,000 sq miles) of land stretching across Syria and Iraq, imposed its rule on almost eight million people, and generated billions of dollars from oil, extortion, robbery and kidnapping.
After five years of bloody battles, local forces backed by world powers have driven IS out of all but a few hundred square metres.
But the group is by no means 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.
How many militants are left in Baghuz?
It is not known. At the start of March, when the SDF began its final assault on the village, commanders estimated there were a few hundred militants holed up inside.
But the Kurdish-led 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.
As many as 20,000 children and women – many of them foreign nationals – have since been evacuated to an SDF-run camp for displaced people at al-Hol, swelling its population to 70,000 and overwhelming aid workers. Several thousand men have also surrendered and been taken to separate SDF detention centres.
Militants who chose to stay in Baghuz continued to put up fierce resistance, deploying suicide bombers and car bombs, but by Monday they had been driven back to a small patch of open farmland next to the Euphrates that was covered in tents, vehicles and foxholes.
On Tuesday morning, SDF spokesman Mustafa Bali said it had taken control of the encampment and that the last militants had retreated to the riverbank.
“This is not a victory announcement, but a significant progress in the fight against [IS],” he cautioned in a Twitter post. “Clashes are continuing as a group of [IS] terrorists who are confined into a tiny area still fight back.”
Mr Bali added that hundreds of sick and wounded militants had been captured by the SDF as it took the encampment and that they had been taken to hospitals.
Are SDF fighters celebrating too early?
On Tuesday afternoon, the BBC’s Aleem Maqbool saw lorries leaving Baghuz packed with what he was told were hundreds of militants, as well as SDF fighters celebrating on their return from the front lines.
Jiaker Amed, a spokesman for the Kurdish militia that dominates the SDF, told our correspondent they were celebrating “a victory for all humanity”.
Mr Amed declared that all IS territory in Baghuz had been retaken, although he admitted that some militants might be hiding underground in tunnels.
Later, Mr Bali told Reuters news agency that fighting was continuing and that militants remained “in several pockets”. “Their presence is not limited to a defined geography,” he added.
The Syrian Observatory for Human Rights, a UK-based monitoring group, meanwhile reported that at least 14 SDF fighters were killed and 30 others injured by IS gunfire and landmine explosions as they attacked the encampment.
An Italian man fighting for the SDF, Lorenzo Orsetti, was killed on Sunday.
Even with its defeat in Baghuz imminent, IS released a defiant audio recording purportedly from its spokesman Abu Hassan al-Muhajir that asserted that the caliphate was not over.
Muhajir accused US President Donald Trump of “falsely” announcing victory over IS in Syria in December, and insisted IS leader Abu Bakr al-Baghdadi was alive.