Many children who have survived and escaped from the Islamic State terror organization's crumbling territory have a tragic story, one of abandonment, of exploitation, of atrocity, but now these so-called children of the caliphate must confront predicament; nobody knows what to do with them.

With IS on the brink of imminent territorial defeat, children have left the embers of the so-called caliphate in their droves towards sprawling refugee camps in northeastern Syria. Relatively safe for the moment, their futures now depend on how the international community decides to deal with them.

More than 2,500 children of at least 30 different nationalities languished in three major camps awaiting a decision on their future. Their rehabilitation into society revolves largely on what course their countries of origin decide to take.

"The international community needs to act now before it is too late," said Sonia Khush, a director at Save the Children's Syrian emergency operations.

The NGO attends to the minors arriving at the camps and expects another swell of children when IS territory collapses completely.

In recent days, thousands of people, mainly families, have fled the IS' last pocket of control near Al-Baghouz, a nondescript town on the banks of the Euphrates in southeastern Syria, near the Iraqi border. Only the most die-hard fighters remain entrenched there.

The Syrian Democratic Forces, a United States-backed militia group dominated by the Kurdish People's Protection Units (YPG) were preparing to deal a final blow to IS territory in the coming days.

Hundreds of refugees handing themselves over to the SDF were children: sons and daughters of IS fighters, kidnapped minors and those swallowed up by the caliphate's rapid expansion.

Many arrive at the camp in a state of desperation after months of limited or non-existent medical attention and little food.

David del Campo, director of Save the Children's international program, denounced that many of the children were facing harsh conditions just for having lived in the caliphate.

"They are not children of the IS, they are simply children," he said.

There are children from Afghanistan, Albania, Saudi Arabia, Algeria, Australia, Azerbaijan, Bangladesh, Belgium, Canada, China, Denmark, Egypt, France, Georgia, Iraq, Germany, Indonesia, Italy, Kazakhstan, Kosovo, Kyrgyzstan, Lebanon, Libya, Macedonia, Malaysia, Morocco, the Netherlands, Pakistan, Portugal, Russia, South Africa, Sudan, Sweden, Syria, Tajikistan, Tunisia, Ukraine, the United Kingdom, the United States, Uzbekistan and Yemen.

Although some of these countries have begun to show interest in the issue of what to do with the children, most, including several European nations, have so far not taken any measures to tackle the situation, Save the Children said.

Only Russia has repatriated a group of Russian minors, amid a wider debate as to who should take on the responsibility of prosecuting foreign IS fighters.

The SDF has said it was overburdened with 5,000 prisoners and has urged the international community to take responsibility for international detainees.

Del Campo said foreign children in the Syrian camps should be looked after by their country of origin, regardless of who their parents were.

"A child is a child in any circumstance," he added.

The United Nations has also called for international governments to help repatriate and rehabilitate the children of the caliphate, many of whom were unaccompanied.

Unicef, the UN's children's agency, said foreign governments should work together to ensure the children were rehabilitated into society without fear of stigmatization and without treating them like terrorists.

Separated from the rest of the population in the Kurdish-administered camps, children of families linked to IS members have less access to aid and services, Save the Children said.

Al-Hol camp, located in Syria's al-Hasakeh region, was now home to more than 40,000 people. The smaller camps, Ayn Issa and Roj, were home to 12,000 and 1,500 refugees respectively.

In recent days, busloads of people were evacuated from al-Baghouz to the SDF-controled camps.

Most of the children in the camps, some of them newborns, live with their mothers, many of whom, in turn, were kidnapped and raped by IS fighters.

Temporary guardians are allocated to those who turn up at the camps alone.

Yet, escape from the IS does not guarantee safety: at least 60 children have died in the camps themselves as the region of Syria went through an unusually frigid winter, the UN said.

"The situation in al-Hol camp is heartbreaking. Children are dying from hypothermia as their families flee to safety," Elizabeth Hoff, the World Health Organization's representative in Syria, said recently in a statement.

Save the Children's Khush said the children at the camps were not receiving the necessary specialist aid, given the volatility of the region.

Children aged 12 regress to the behavior 4-year-olds, they wet themselves, they cannot sleep at night, they have nightmares and anxiety, Del Campo said in a recent report.

"They have seen their friends, families, neighbors killed or they have borne witness to the destruction of their homes and schools," he said, adding that in northern Syrian there were only 20 psychologists available for 4.5 million children.

The situation was even direr for Yazidis, an ethnic and religious minority from the Sinjar province of northern Iraq.

The IS led a massacre against the Yazidi people in 2014 in what the United Nations has labeled a genocide. Around 4,000 Yazidis were killed and perhaps 10,000 others, mainly women and children, were kidnapped.

The IS forced many of the captive women and girls into sex slavery.

Around 600 Yazidis remained unaccounted for, said Jan Ilhan Kizilhan, a German psychologist and a university professor in Baden-Wurttemberg in Germany and in Duhok in Iraqi Kurdistan.

He has treated more than 1,400 young Yazidis brought into sex slavery.

"The medical and psychological problems occurring as a result of the combination of individual perception of traumatic experiences, collective and cultural trauma and the subsequent migration and refugee crisis are therefore quite extraordinary," he said. "They require new and well thought out concepts of integrated medical care.

"In general, with a good and long term support it will possible to have a 'normal' life and able to cope the trauma," Kizilhan, who has over 20 years experience dealing with the psychological consequences of warfare, added.

Save the Children has under its belt successful aid programs in South Sudan, the Democratic Republic of Congo, Myanmar and now it was trying to replicate that success in Jordan and Lebanon, which are home to millions of displaced Syrians.

"Its a slow and arduous road, but enormously comforting," Del Camp said.

Syria's civil war erupted in 2011 after the government clamped down on popular protests sweeping the region.

It has gone on to claim the lives of roughly half a million people, according to the Syrian Center for Policy and Research.

At its height, the IS caliphate stretched across northern and central Iraq and Syria, swallowing up the ancient and densely populated cities of Mosul and Raqqa.

By Mara Rullán