More than 2,500 foreign children from 30 countries who have fled the Islamic State group’s last redoubts are living in desperate conditions in camps in northeastern Syria, Save the Children said on Thursday.

The charity urged their countries of origin to “take action to ensure the safety of their citizens” as US-backed forces battle IS in the final sliver of territory it holds near the Iraqi border.

“They need specialised help to recover from their experiences and return to normality, together with their families,” the charity said.

“This is impossible in overwhelmed displacement camps in a volatile warzone. The international community must act now before it is too late.”

It said the children, including 38 unaccompanied minors, were from families “with perceived or actual associations” with IS.

They were separated from others in the camps, affecting their access to aid and services.

“Harsh winter conditions have left the camps in a desperate state, with children facing life-threatening risks,” it said.

The children are “victims of the conflict and must be treated as such”, said Sonia Khush, Save the Children’s Syria response director.

“All states whose nationals are trapped in Syria must take responsibility for their citizens.”

The charity said the children had already been deprived of adequate medical care and food for months or even years while in IS-held areas, even before having reached the displacement camps.

“While some states have begun to do so, many countries – including several European countries – have yet to take steps to ensure the safety of the children and their families,” said Khush.

“Given the life-threatening dangers these children and their families face in Syria, this is unconscionable.”

Save the Children urged countries to repatriate the children and their families “for the purposes of rehabilitation and/or reintegration, in full compliance with international law, including the right to a fair trial where appropriate”.

After years of battling IS and with all but a sliver of land left under IS control, US-backed forces have detained hundreds of foreigners suspected of being IS fighters, as well as related women and children.

Syria’s Kurds, whose fighters have been at the forefront of the battle, have long urged their home countries to take them back, but many nations have been reluctant.

US President Donald Trump has urged European governments to take back their citizens who fought for IS in Syria, but his administration said on Wednesday it would refuse entry to a US-born IS member who wants to return from Syria.

The country’s conflict has killed more than 360,000 people and displaced millions since it started in 2011 with the repression of anti-government protests.