Pennsylvania's highest court on Thursday overturned hundreds of juvenile convictions issued by a corrupt judge accused of taking millions of dollars in kickbacks to send kids to privately owned detention centers.

The state Supreme Court ruled that former Luzerne County President Judge Mark Ciavarella violated the constitutional rights of youth offenders who appeared in his courtroom without lawyers between 2003 and 2008.

"Today's order is not intended to be a quick fix," Chief Justice Ronald Castille said in a statement. "It's going to take some time, but the Supreme Court is committed to righting whatever wrong was perpetrated on Luzerne's juveniles and their families."

In one of the most egregious cases of judicial corruption ever seen, federal prosecutors charged Ciavarella and another Luzerne County judge, Michael Conahan, with taking $2.6 million in payoffs to put juvenile offenders in private lockups.

The judges pleaded guilty to fraud last month and face sentences of more than seven years in prison.

The high court approved the recommendations of Berks County Senior Judge Arthur Grim, who was appointed to review cases handled by Ciavarella. He advised expunging the records of low-level offenders who appeared in Ciavarella's courtroom without lawyers — a group he has said numbered "easily into the hundreds."

Under Pennsylvania law, a juvenile may not waive his right to an attorney unless the decision is made "knowingly, intelligently and voluntarily." The judge must also make sure defendants understand their rights.

In a report to the Supreme Court released Thursday, Grim said he has determined that "a very substantial number of juveniles who appeared without counsel before Judge Ciavarella ... did not knowingly and intelligently waive their right to counsel."

Grim next will review cases involving more serious juvenile offenses.