With the downfall of the Islamic State group in Syria, the world is facing the challenge of what to do with the thousands of locals and foreigners who fled the crumbling caliphate — among them at least 70 Australian children.

Key points: Over 1,500 minors are serving jail terms in Iraq for alleged IS membership

Over 1,500 minors are serving jail terms in Iraq for alleged IS membership Children said they were tortured during interrogations and forced to confess

Children said they were tortured during interrogations and forced to confess 185 foreign minors have been convicted of terrorism charges in Iraq

Reluctant to allow "radicalised" citizens to return home, the international community has increasingly looked for a solution across the border in Iraq, where many Iraqis and foreigners have already been sent to face sentences ranging from 15 years in prison to the death penalty, for terrorism charges including alleged IS membership or holding a public service position under their rule.

Among those who have been imprisoned and tortured for non-violent service roles — such as driving IS members, or serving them in restaurants — are thousands of minors as young as nine, who typically receive sentences of 5 to 15 years in prison, according to Human Rights Watch (HRW).

As the US engages in negotiations with Baghdad to send thousands more to face Iraqi courts, experts fear the harsh sentencing of children emerging from years under forced IS rule — where their schools were transformed into radical Islamic education camps — could aid in the creation of a new generation of Islamic militants.

"Putting them into jail, exposing them to more violence, will reinforce the narratives ISIS have implanted in their heads about the outside world," said researcher Salah Al-Ansari from the London-based think tank Quilliam, who emphasised the need for deradicalisation programs and social rehabilitation.

"These children have already suffered from exposure to violence and normalisation to violence — it has destroyed their lives completely."

Dr Stacy Drury, a neuroscientist and child psychology researcher at Tulane University in Louisiana, agreed.

"It's bad on every level," she told the ABC.

"If I was trying to find a way to create radicalised future people, this would be a great way to do it."

'Everyone must confess'

Minors detained by Iraqi authorities said they were beaten and tortured into confessing IS membership. ( Reuters: Muhammad Hamed )

In a report released last month, HRW documented 1,500 cases of minors as young as nine that have been convicted of IS association and are serving time in Iraqi prisons. They are often kept in crowded cells with adult prisoners, and tortured to obtain confessions.

Jo Becker, advocacy director of HRW's child rights division, described their prison conditions as "overcrowded and unsanitary".

Child trainees were known as "cubs of the caliphate". ( Dabiq )

One cell, roughly 4x6 metres with a single toilet, held 114 prisoners.

She said the children described being beaten with plastic pipes, electric cables, held in stress positions for long periods and sometimes given electric shocks in order to obtain a confession.

"We heard really disturbing reports from kids who said their interrogators didn't really seem to care if they were guilty or not," Ms Becker told the ABC.

"One said, everyone must confess. It doesn't matter if you were part of ISIS or not, everyone must confess."

One boy who was arrested at the age of 13 described his interrogation.

"They were beating me all over my body with plastic pipes. First they said I should say I was with ISIS, so I agreed," said the boy known as Khalaf.

"Then they told me I had to say I worked for ISIS for three months. I told them I was not part of ISIS, but they said, 'No, you have to say it'."

Dr Drury said being held with adult IS suspects could leave children exposed to the influence of terrorist leaders.

She said the risk of radicalisation, even for those who had no former affiliation with the group, was particularly high in these early years when "peer environment is incredibly important in shaping your value system".

'Deeply flawed' system requiring 'little to no evidence'

Suspects are often sentenced with "little to no evidence" in court cases that last around 5 to 10 minutes. ( ABC News: Tracey Shelton )

In 2015, as the Islamic State reached its height, the ABC witnessed men and teenage boys being rounded up in Sunni Arab areas of Kirkuk by security forces. The men were taken away in trucks for "questioning".

Ms Becker said the current screening process, while less arbitrary, is still "deeply flawed", with suspects being sentenced with "little to no evidence", in court cases that last around 5 to 10 minutes.

One Iraqi lawyer, who did not want to be named, told the ABC that normal criminal cases usually take 6 to 12 months, but the sheer number of those who stand accused of IS membership, and the threat to national security they could pose, has led to hasty trials.

Once branded as IS members, children who may have had little or nothing to do with IS face long-term stigma and displacement, and could be at risk of revenge attacks on their release.

"We're not saying children shouldn't be prosecuted," Ms Becker said.

"If they have evidence that children have committed violent crimes while they were with ISIS they can be prosecuted, but there needs to be real evidence of those crimes, not just coerced confessions."

Natalie Turgut, Child Rights Policy and Advocacy Adviser for the NGO War Child, said children associated with armed forces should be viewed as victims of the conflict.

"We fear that criminalising children will exacerbate their experiences and undermine reintegration attempts," she said.

"We want children to return to normality as soon as possible, reunifying them with family, if possible and appropriate, getting them back into school or organising vocational training to re-enter society as productive contributors."

She added that psychosocial support, such as counselling and group activities, give children time to process what has happened.

A global problem

Eight-year-old Humzeh Sharrouf in the al-Hawl refugee camp. ( ABC News: David Maguire )

Hundreds of foreigners including French, German and Swedish citizens and at least 185 foreign minors have been convicted of terrorism charges in Iraq, according to HRW and Iraqi government figures.

Loading

Thousands more foreign children are being held in prison cells with their mothers, who are serving lengthy sentences or waiting on death row.

On a visit to the Rusafa women's prison in Baghdad this week, Reuters reported finding 774 children aged from nine months to 15 years from more than a dozen countries.

In Syria, UNICEF reported close to 3,000 foreign children from 43 countries at the Al-Hol displacement camp alone, including the Sharrouf children who travelled to Syria with their now-deceased Australian parents.

While the Australian Government is yet to make a decision on the repatriation of IS children or adults, many foreign nationals, including one Australian, have been sent from Syria to Iraq, where they could face the death penalty.

Other nations across the globe including Indonesia, Tunisia, Kosovo and Russia are struggling to find a balance between punishment and deradicalisation, as hundreds of IS fighters and their families return home after years immersed in a brutal and violent system.