Dozens of ISIS militants emerged from tunnels to surrender to US-backed forces in eastern Syria on Sunday, a day after their "caliphate" was declared defeated.
Syria's Kurds warned that despite the demise of the proto-state, the thousands of foreign fighters they have detained are a time-bomb the world urgently needs to defuse.
Dozens of people – mostly men – file out of the battered militant encampment in the remote village of Baghouz near the Iraqi border to board pickup trucks.
"They are ISIS fighters who came out of tunnels and surrendered today," Kurdish spokesman Jiaker Amed said.
Some sported thick beards and wore long woollen kaftans over their dark-coloured robes, or a chequered scarf around their faces, as they trudged out of their final hideout under the drizzle.
"Some others could still be hiding inside," said Mr Amed.
World leaders were quick to hail Saturday's announcement by the Kurdish-led Syrian Democratic Forces that the last shred of land controlled by ISIS in Syria had been conquered.
But the top foreign affairs official for the country's semi-autonomous Kurdish region warned that ISIS members captured during the assault still posed a threat.
"There are thousands of fighters, children and women and from 54 countries, not including Iraqis and Syrians, who are a serious burden and danger for us and for the international community," Abdel Karim Omar said.
"Numbers increased massively during the last 20 days of the Baghouz operation," he said.
He also warned of the continuing danger posed by ISIS sleeper cells.
As the SDF's months-long assault closed in against the last ISIS strongholds in the Euphrates Valley, militants and their families gradually gathered in Baghouz.
While some managed to escape, many foreigners stayed behind, either surrendering or fighting to the death.
According to the SDF, 66,000 people left the last ISIS pocket since January, including 5,000 militants and 24,000 of their relatives.
The assault was paused multiple times as the force allowed people to evacuate from the enclave on the banks of the Euphrates.
The SDF have screened droves of people scrambling out of Baghouz in recent weeks, detaining suspected exremists and trucking civilians and ISIS relatives to camps further north.
Most relatives have been crammed into the Al Hol camp, a facility built for 20,000 people but which now shelters 72,000.
The Kurdish administration in north-eastern Syria has warned it does not have capacity to detain so many people, let alone put them on trial.
But the home countries of suspected IS members are reluctant to take them back, due to potential security risks and the likely public backlash.
Several held in Syria have been stripped of their citizenship.
"There has to be co-ordination between us and the international community to address this danger," Mr Omar said.
"There are thousands of children who have been raised according to ISIS ideology," he said. "If these children are not re-educated and re-integrated in their societies of origin, they are potential future terrorists."
The SDF's main support has been the international military coalition launched by the United States in mid-2014 to counter the expansion of ISIS.
US President Donald Trump vowed to drastically scale down US military presence in Syria once ISIS was defeated, leaving the Kurds exposed to threats by Damascus and Turkey.
Ankara sees the SDF as a terrorist organisation and Mr Omar warned that any cross-border offensive risked leading to mass breakouts from the jails where extremists are currently held.
"Any new threat or new war would give an opportunity to these criminals to slip out," he said.
ISIS, faced with multiple offensives in Syria and Iraq since 2014, has morphed from a territorial force back into a clandestine insurgency group carrying out hit-and-run attacks in both countries.
The SDF's top commander said on Saturday that anti-IS operations were entering a new phase.
Mazloum Kobane said the new focus would be ISIS sleeper cells that "are a great threat to our region and the whole world".