Children linked to the so-called Islamic State have faced torture and charges of terrorism from Iraqi and Kurdish authorities, Human Rights Watch has said.
In a report released on Wednesday, the NGO added that many of the charges were brought under "dubious accusations" using "forced confessions obtained by torture."
Authorities are believed to be holding around 1,500 children suspected of links to IS.
An 18-year-old male that was held in Iraq gave HRW a harrowing account of being beaten and burned with cigarettes in order to gain a confession.
"They covered my eyes and cuffed my hands and tortured me using plastic pipes," he said.
"They said: 'Confess that you were with IS.' I told them I wasn't. They put out cigarettes on me. They hit me with cables and sticks. They tortured us."
Another teenager, who was also held in Iraq, said he hadn't seen his family for several years.
"I was locked up for a year and four months," he said.
"Being away from my family is really hard. I haven't seen them for more than two years. I haven't seen them for so long. I think about them 24 hours a day."
According to the report, the young detainees are often sentenced to prison in hasty and unfair trials, ignoring the norms of international law that recognises children recruited by armed groups as victims.
Belkis Wille, a senior Iraq researcher at HRW, pointed to fundamental issues in Iraq's justice system leading to such charges.
"The Iraqi justice system is incapable of properly investigating and addressing and prosecuting these offences," she said.
"This is a criminal justice system that does not provide the right to a fair trial. It does not provide the right for victims, victims of these very serious ISIS abuses to participate."