CHICAGO (AP) – A Chicago judge has ruled that a state law allowing children as young as 10 to be locked up prevails over a Cook County ordinance banning those younger than 13 from being sent to juvenile detention.

Juvenile Court Presiding Judge Michael Toomin issued the ruling Wednesday in ordering two 12-year-old boys be confined. The Chicago Tribune reports the boys face armed robbery charges and have repeatedly damaged electronic monitoring devices to run away from home.

The Cook County Board of Commissioners unanimously approved the ordinance last month, with members saying juvenile detention wasn’t appropriate for preteens.

Toomin wrote that the county’s ban provides no viable alternative to incarceration for children who pose a public threat.

Lawyers for both boys said they would appeal the ruling.