US-backed fighters cornered the Islamic State group in a last part of Tabqa on Monday, after tearing down a huge jihadist flag that had fluttered over the northern Syrian city.
The Syrian Democratic Forces (SDF), an alliance of Kurdish and Arab fighters, were left in control of all but a fifth of Tabqa, a monitor said.
The city sits on a strategic supply route about 55 kilometres (35 miles) west of IS's main Syrian stronghold Raqa and served as a key IS command base.
The SDF broke into Tabqa from the south a week ago and steadily advanced north, squeezing IS in three contiguous neighbourhoods on the bank of the Euphrates River.
At dawn on Monday, IS fighters withdrew from the western-most district towards the other two neighbourhoods, said Rami Abdel Rahman, head of the Syrian Observatory for Human Rights monitoring group.
"The SDF now controls more than 80 percent of Tabqa," Abdel Rahman said, with IS only holding the two northern neighbourhoods of Hurriyah and Wahdah.
At least 35 IS fighters were killed since Sunday in clashes and air strikes in Tabqa, the Observatory said. It had no immediate information on casualties among SDF fighters.
In the aptly named Flag Roundabout in Tabqa's west, an AFP correspondent on Sunday saw an SDF fighter climb a ladder propped on a huge flagpole.
He triumphantly pulled down an enormous black IS flag, dropping it to the rubble-littered street as fellow fighters cheered and took pictures.
"We've brought down Daesh's flag and we'll hang our own -- the flag of the Syrian Democratic Forces," SDF fighter Zaghros Kobane told AFP, using the Arabic acronym for IS.
Other IS propaganda could still be seen around the city, including a billboard of a balaclava-wearing jihadist with three warplanes behind him.
"We will be victorious despite the global coalition," the billboard read.
- 'Toughest battle' -
Tabqa is home to an estimated 85,000 people, including IS fighters from other areas. Many families have fled the incoming offensive, lugging jerrycans, packed suitcases and blankets as they marched out of the city.
But other civilians have stayed on in neighbourhoods newly seized by the SDF, and AFP's correspondent saw women and toddlers timidly peering out at SDF fighters from behind the gates of their front yards.
The city is also adjacent to the strategic Tabqa dam, which remains under IS control.
The SDF said their hard-fought advance had seen jihadists surrendering in large numbers.
"Tabqa is the toughest battle we've ever waged," said SDF commander Jako Zerkeh, nicknamed "The Wolf".
Zerkeh said the SDF had used new tactics -- including the waterway supply line and an airlift behind enemy lines in late March -- to kickstart the offensive.
"These were a huge surprise to them and shattered their morale... Dozens of Daesh (IS) fighters have surrendered. There were more surrenders here than any other town," he told AFP.
In an online statement Monday, the SDF said its fighters had seized three IS tanks as well as a bomb-making factory in Tabqa.
- 'Wrath of the Euphrates' -
The assault on Tabqa began in late March when SDF forces and their US-led coalition allies were airlifted behind IS lines.
The SDF surrounded Tabqa in early April before pushing into the city on April 24, as part of their flagship offensive for Raqa further east.
That assault, dubbed "Wrath of the Euphrates", was launched in November and has seen SDF fighters capture swathes of countryside around the city.
In a new report, Human Rights Watch said government forces had used deadly nerve gas in Khan Sheikhun and in three other recent attacks, as part of a "clear pattern" of chemical weapons use that could amount to crimes against humanity.
President Bashar al-Assad's forces are also stepping up chlorine gas attacks and have begun using surface-fired rockets filled with chlorine in fighting near Damascus, the US-based group charged.
At least 92 people including 30 children died in the suspected sarin gas attack in Khan Sheikhun -- a rebel-held town in northwest Syria's Idlib province -- on April 4, according to local residents and activists.
Last month, Assad told AFP in an interview that the Khan Sheikhun attack was "100 percent" fabricated, serving as a pretext for US missile strikes on a Syrian air base.
More than 320,000 people have been killed in Syria since the country's war began with anti-government protests in March 2011.
The US-led coalition bombing IS in Syria and Iraq said on Sunday that its strikes had unintentionally killed 352 civilians since the intervention began in 2014.
Critics say the real total number of civilian deaths is much higher.