In a corner of a teeming refugee camp, 40 miles north of Raqqa, a small group of women and children are kept alone. They mill together at the back of a blue building; blond and brown haired children darting in between blankets that their mothers have hung as doors across small, dank rooms. Others in the Ain Issa camp call them “the Daeshis”, meaning Islamic State families. No one wants to know them.

The women are widows of dead Isis fighters. All are foreigners, with futures more bleak than the 12,000 or so newly displaced of Syria and Iraq in the camp, or the many millions more victims of war and insurgency now living in tents across the Middle East.

They arrived with hordes that fled Raqqa from early May. Their faces, and those of their children, were distinctive from the local people, who soon gave them up to the Kurdish officials who run the camp. Families of vanquished jihadis who were thought to be of intelligence value were segregated and taken elsewhere. The broken families left behind are deemed to be of much less use.

As Isis withers, the most vulnerable among its ranks are becoming ever more exposed. In northern Syria, where Kurdish forces have pushed deep into Raqqa, and in Iraq, where its military, supplemented by state-backed Shia militias, have now ousted the group from every urban centre, the women and children of the terror group have nowhere to hide.

International aid agencies and governments are scrambling to assess the numbers of widows and orphans now thought to be at extreme risk, both within their societies and at the hands of predatory local officials. “No one will deal with them, or even touch them,” said Ahmed al-Raqqawi, a 25-year-old anti-Isis fighter in the centre of Raqqa. “When they were here, they used to think they were kings. Even the women.”

The fall of Raqqa: hunting the last jihadists in Isis's capital of cruelty Read more

By some estimates as many as 5,000 women have given birth to children of foreigners in the past four years in countries that – even in normal times – would offer limited civic protections. Stigmatised, traumatised and stateless, some family members are pleading with the countries of their dead husbands’ birth to take them in. So far, the response has been largely muted, with Britain, France, Australia and much of Europe acknowledging that they are yet to decide on what to do about Isis children in particular. “The women who chose to leave the UK and go there need to be responsible for what they did. They will not be coming home,” said a British official. “The children, though, deserve compassion.”

On Friday, France appeared to flag an advance in its position, with the defence minister, Florence Parly, announcing on French radio that the children of its dead nationals may be taken in, but not their mothers.

“Children who are in local custody can, depending on their parents’ preference, either stay with them while their parents get tried locally, or be repatriated to France, where they will be cared for by social services. They are usually very young, but they can have been radicalised and need to be watched. The challenge for us is to turn them into citizens again,” said Parly.

Over the past three months, the United Nations has been lobbying countries whose nationals had fathered children in Isis territory to come up with a solution. “UNHCR is very concerned about the fate of the children and the risk of statelessness they face,” said Rula Amin, spokesperson for the Middle East and North Africa. “UNHCR has a mandate to support governments to prevent statelessness and protect stateless people.

“We, therefore, strongly advocate for the governments of the relevant countries to register the births of these children and ensure that they have a nationality. This is vital to enabling these innocent, young victims of war, who have already endured and witnessed so much suffering, to reside legally in a country together with their families, grow up with a sense of identity and belonging to a society, go to school, fulfil their potential and have the hope of peaceful and constructive futures.”

In the Ain Issa camp, tents are reserved for families that have come from Isis areas but don’t necessarily belong to the organisation. Some are relatives of leading figures. Some made their accommodations when Isis came to town three years ago, and others, like Abu Jassem from Falluja in Iraq, have an affiliation that dates back a decade. Surrounded by deeply suspicious men, he said he had moved in the past three years from Falluja to Bukamal on the Iraqi border, then Deir Azzour: “Everywhere we go the airstrikes have followed us.”

The men said they knew nothing of the Isis widows housed a few hundred yards away, and they did not seem to care. One man wheeled out from behind the curtain a severely disabled 12-year-old girl, who could neither move nor talk. She was born after the second Falluja war. Ever since that battle, the number of birth defects in the city has been far higher than national averages. No one has yet determined why. “We have more to worry about than they do,” said Abu Suhail. “They chose their fate.”

Across the Iraqi border, south of Mosul, which was recaptured by Iraqi forces in July, Abdul Wahab al-Saadi, the deputy commander of an anti-terrorism division, confessed to being puzzled. His forces are guarding some 1,800 women and children in derelict buildings. Nearly all are foreigners.

“There is lots of talk of rehabilitation – which in my personal view is the humane way to go about this,” he said. “Based on Iraqi law, you cannot hold relatives of a criminal accountable for his actions and prosecute them. But this is what we’re doing. The thing is our community, Iraqi traditions and values won’t allow for the easy forgiveness of these families. The international community must get involved, Iraqi civil society along with local authorities should work on more rehabilitation programmes so that we can reinstate these people back into our society.”

Hawija: Iraqi army says it has recaptured one of last Isis enclaves Read more

The local communities seem unlikely to do that. A flyer distributed to Isis families read: “Your sons of Isis have mistreated and harmed the good and peaceful people of this town. You must leave, you have no place here and our patience has worn thin. Do not be in the way of our bullets that are meant for your disgraced sons. You have nothing but shame and disgrace; our martyrs eternity and glory.”

Sukainah Mohamad Younes has been asked by officials in Mosul to find a solution for the desperate children in her area: “There are more than 1,500 Isis families of locals divided between camps Hamam Al Alil, Jadaa and Qayyara. You have Syrians and Russians and Chechens and other nationalities. I’ve recently sent 13 children of Isis fighters to an orphanage.

“I’ve managed to send a few orphans to school despite them being stateless and with no identification cards; however, some don’t even have shoes on their feet … These Isis kids are victims.

“The locals are separated from the foreigners. We do not know what will become of either the locals or the foreigners. There are no strategic plans. Recently four Chechen kids were picked up by a Chechen leader. A little Russian girl was also picked up by a Russian delegation. The locals have it much harder, who is going to take them in? No one. … No one is willing to, and I can’t see them returning to their home towns, they are not welcomed there. But how is this a child’s fault? Let me tell you something and mark my words, if we do not take care of these kids – locals or foreigners – they will grow up to be worse than Isis.”

Lorries with Syria’s newest refugees arrive each day in Ain Issa. In Raqqa a few stragglers from Isis districts make their way to the Kurdish side each week. “We don’t bother them, we send them to the security forces,” said Elyas, who leads a frontline team. “They stay with them for about a month, and then many of them are free.”

Not so the foreigners holed up in the camp. On the wall of one room, a woman had written in Arabic: “Oh God, let it rain on my heart, so it can drown out all my sorrow.”

Additional reporting by Nadia al-Faour and Mohammed Rasool