Mr. Polat, the deputy warden, later said the authorities had indications that many of the minors had been through ideological training as “cubs of the caliphate,” or future fighters. Plans to move the youngest prisoners to rehabilitation centers had been delayed, he said, because of the Turkish incursion and the lack of international support.

Under United Nations standards for juvenile justice, even minors suspected of crimes should be detained only as “a measure of last resort and for the shortest possible period of time,” pending trial.

While the Islamic State did train boys for combat, it was unclear if that was true of the boys in the prison. None were awaiting trial, because the Syrian Kurdish authorities do not try foreigners.

The United Nations also says detained juveniles should receive “all necessary individual assistance,” including education, medical care and counseling.

The boys in prison said they received almost no services.

“The situation is pretty bad here, so if they could hurry up and decide,” said a 16-year-old boy from Mauritius. “Months like this without knowing what is going to happen, people could start going crazy. They could say these guys were terrorists before with ISIS, but they are still human.”