Islamic State group jihadists using tunnels and suicide bombers were mounting a desperate defence Thursday of their last square kilometre in eastern Syria.
Kurdish-led forces closed in on the small town of Baghouz where IS group fighters and their relatives were hunkered down and met famished and dishevelled people turning themselves in.
"The fighting is fierce," said Adnan Afrin, a spokesman for the Syrian Democratic Forces, the Kurdish-Arab outfit that has spearheaded the campaign against IS group with backing from a US-led coalition.
"There is significant resistance," he told AFP in Al-Omar oil field, the main staging base for the SDF's offensive against the very last shred of the original IS group "caliphate".
The few hundred fighters of various nationalities holding out in their last bastion by the Iraqi border have launched bruising counter-attacks in recent days, Afrin said.
The jihadists are clinging to about one square kilometre in the town's built-up area, as well as to an adjacent camp, where a number of civilians are believed to be gathered.
Afrin said it was impossible to provide accurate figures but he estimated the total number of fighters, men and women, at around 1,000.
"There are many tunnels in Baghouz now. This is why the operation is dragging on. There are many suicide bombers attacking our positions, with explosives-laden cars and motorbikes," he said.
Afrin said two such suicide attacks were carried out by women on Tuesday but he would not provide any figures on casualties among SDF ranks.
People continued to trickle out of the last IS group redoubt every day, trudging up a dirt road to a collection point where SDF fighters and volunteers provide first aid and carry out a first screening.
The major influx of the past few days slowed to a trickle on Thursday but it was unclear how many civilians remained trapped inside the jihadists' last redoubt.
Many of those who snuck out had to sleep outside in the cold to reach the SDF, where a lucky few get tents while the rest were spread out on cheap blankets.
"The kids were crying all night from the cold," said Fatima, an Iraqi woman from Baghdad who fled Baghouz with her four children, all under 15.
"This is the second night we sleep outside. There was so much bombing in Baghouz that it was safer for us to sleep in the open," she told AFP.
The SDF has restricted media access to the front line since an Italian journalist was wounded earlier this week.
The US-led coalition is carrying out air strikes on the area while its forces are also present on the ground, sifting through the displaced for wanted jihadists.
Afrin said SDF forces tuning their walkie-talkies on the jihadists' frequencies "can hear them speak in Arabic but also in Turkish, French and English."
Once the adult men have been separated from their families, foreign and SDF officers thumb through pictures on smart phones to ask new arrivals about wanted IS group leaders.
IS group's elusive Iraqi-born supremo, Abu Bakr al-Baghdadi, is not believed to be among the last jihadist leaders holed up in Baghouz.
Several known jihadist figures have emerged from the dregs of the "caliphate" in recent days however, including German Martin Lemke and Frenchman Quentin Le Brun.
A rift appears to have grown between foreign members of IS group who have nowhere to hide and local fighters who are attempting to blend back into the population as the organisation goes underground again.
The "caliphate" Baghdadi proclaimed in mid-2014 once spanned territory the size of the United Kingdom and administered millions of people.
It printed its own schoolbooks, produced oil, collected taxes and minted its own currency, in a brief but unprecedented experiment in jihadist statehood.
Successive offensives in Iraq and Syria have shattered the proto-state, which lost its key cities one after the other and had since late 2017 been confined to its traditional strongholds in the Euphrates River valley.
An official declaration of victory against IS group is expected in the coming days, a move of mostly symbolic value that will go down as the death certificate of the "caliphate".
While surviving IS group fighters on both sides of the border will no longer hold fixed positions, the jihadist organisation will remain a threat.
The United States is due to pull its troops out of Syria within weeks, creating a vacuum that risks allowing IS group to rebuild and project new ambitions.
The Kurds are also afraid they will have to squander the autonomy they acquired and be left exposed to a military offensive by their archfoe Turkey.