(CNN) -- At a friend's sleepover more than a year ago, 14-year-old Phillip Swartley pocketed change from unlocked vehicles in the neighborhood to buy chips and soft drinks. The cops caught him.

Former Luzerne county President Judge Mark Ciavarella pleaded guilty, faces prison and was disbarred.

There was no need for an attorney, said Phillip's mother, Amy Swartley, who thought at most, the judge would slap her son with a fine or community service.

But she was shocked to find her eighth-grader handcuffed and shackled in the courtroom and sentenced to a youth detention center. Then, he was shipped to a boarding school for troubled teens for nine months.

"Yes, my son made a mistake, but I didn't think he was going to be taken away from me," said Swartley, a 41-year-old single mother raising two boys in Wilkes-Barre, Pennsylvania.

CNN does not usually identify minors accused of crimes. But Swartley and others agreed to be named to bring public attention to the issue.

As scandals from Wall Street to Washington roil the public trust, the justice system in Luzerne County, in the heart of Pennsylvania's struggling coal country, has also fallen prey to corruption. The county has been rocked by a kickback scandal involving two elected judges who essentially jailed kids for cash. Many of the children had appeared before judges without a lawyer. Watch the corruption scandal that is rocking Pennsylvania »

The nonprofit Juvenile Law Center in Philadelphia said Phillip is one of at least 5,000 children over the past five years who appeared before former Luzerne County President Judge Mark Ciavarella.

Ciavarella pleaded guilty earlier this month to federal criminal charges of fraud and other tax charges, according to the U.S. attorney's office. Former Luzerne County Senior Judge Michael Conahan also pleaded guilty to the same charges. The two secretly received more than $2.6 million, prosecutors said.

The judges have been disbarred and have resigned from their elected positions. They agreed to serve 87 months in prison under their plea deals. Ciavarella and Conahan did not return calls, and their attorneys told CNN that they have no comment.

Ciavarella, 58, along with Conahan, 56, corruptly and fraudulently "created the potential for an increased number of juvenile offenders to be sent to juvenile detention facilities," federal court documents alleged. Children would be placed in private detention centers, under contract with the court, to increase the head count. In exchange, the two judges would receive kickbacks.

The Juvenile Law Center said it plans to file a class-action lawsuit this week representing what they say are victims of corruption. Juvenile Law Center attorneys cite a few examples of harsh penalties Judge Ciavarella meted out for relatively petty offenses:

Ciavarvella sent 15-year-old Hillary Transue to a wilderness camp for mocking an assistant principal on a MySpace page.

He whisked 13-year-old Shane Bly, who was accused of trespassing in a vacant building, from his parents and confined him in a boot camp for two weekends.

He sentenced Kurt Kruger, 17, to detention and five months of boot camp for helping a friend steal DVDs from Wal-Mart.

Several other lawsuits on behalf of the juveniles who have appeared in Ciavarella's courtroom have emerged.

Don't Miss

The private juvenile detention centers, owned by Mid Atlantic Youth Services Corp., are still operating and are not a target of the federal investigation, according court documents. The company cooperated in the investigation, the documents said.

A spokesman from the company denied that its current owner, Gregory Zappala, knew about the kickbacks.

Ciavarella assured the community that he could provide justice. Elected to the bench in 1996, he once ran for judge on the promise that he would punish "people who break the law," according to local reports.

The corruption began in 2002, when Conahan shut down the state juvenile detention center and used money from the Luzerne County budget to fund a multimillion-dollar lease for the private facilities. Despite some raised eyebrows from the community, county commissioners approved the deal.

The federal government began investigating in 2006.

"It's been a dark cloud hanging over the county for a very, very long time," said Luzerne County Commissioner Maryanne C. Petrilla, whose office approved the judges' budgets during the corruption. "I'm looking forward to the ship turning around now and us moving in the right direction."

The kickback scandal highlights a major problem in the juvenile justice system in Luzerne County and across the country, attorneys say. They say hundreds of children who appeared before Ciavarella didn't have lawyers.

"Kids think very much in the present, and they have limited abilities to understand long-term consequences," said Robin Dahlberg, an attorney at the American Civil Liberties Union in New York who specializes in juvenile issues.

Dahlberg's recent study in Ohio revealed that some of the counties had as many as 90 percent of children going through the court system without a lawyer.

"This Pennsylvania case is a sad reminder of why kids need an attorney," she said.

A 1967 Supreme Court ruling says children have a right to counsel. However, many states allow children and their parents to appear without an attorney by completing a waiver.

Pennsylvania is among about half of thestates in the country that allow waivers to be signed for juveniles to appear before a judge without an attorney, legal experts say.

In Luzerne County, teens who waived counsel were at greater risk of being sent to placement center than those with representation.

About 50 percent of the children who waived counsel before Ciavarella were sent to some kind of placement, the Philadelphia-based Juvenile Law Center reports. In comparison, the Juvenile Court Judges' Commission in Pennsylvania found that 8.4 percent of juveniles across the state wind up in placement.

"When you have this many kids waiving counsel, then that's way out of line," said Marsha Levick, an attorney at the Juvenile Law Center. "There was no record [Ciavarella] was assuring the child and parent about the consequences of not having representation."

Minors charged with nonviolent crimes were often given harsher sentences than what probation officers recommended, court documents say. Other investigators say the trials lasted a few minutes at most.

All four of the teens cited in this story say they appeared before Ciavarella without lawyers.

"I was sort of shocked and taken aback," Hillary Transue, the MySpace offender who is now 17, said of her experience in Ciavarella's courtroom in April 2007. "I didn't really understand what was going on."

The Juvenile Law Center says it first red-flagged Ciavarella in 1999 after discovering that a 13-year-old boy was detained without being read his rights and had appeared in court without a lawyer. When the case became public, Ciavarella promised the public that every minor in his courtroom would have a lawyer.

Judges must verbally explain the consequences of appearing in court without counsel to minors and parents, lawyers say. Juvenile Law Center officials say Ciavarella neglected to do so in many cases.

Yet in the past five years, attorneys, law enforcement officials and other judges did not report Ciavarella's behavior to the Judicial Conduct Board of Pennsylvania, says Joseph A. Massa Jr., chief counsel at the board.

Privatizing detention facilities is a growing in popularity among governments because the companies say they offer lower rates than the state.

Pennsylvania has the second highest number of private facilities after Florida, accounting for about 11 percent of the private facilities in the United States, according to the National Center for Juvenile Justice in Pittsburgh, Pennsylvania.

Critics say private prisons lack transparency because they don't go through the same inspections and audits as a state facility, and this may have allowed payoffs to go so long without being noticed.

"Once somebody is going to make more money by holding more kids, there is a pretty good predictable profit motive," said criminal justice consultant Judith Greene, who heads a nonprofit group called Justice Strategies. "It's predictable that companies are going to tolerate certain behaviors they shouldn't."

An audit draft obtained by the Philadelphia Inquirer showed that Luzerne County was spending more than $1.2 million in expenses that weren't allowed under state regulations. The Pennsylvania Department of Public Welfare, the agency overseeing the audits, says the audit drafts are not final.

The audits also allege that two people paid the judges. Attorneys for former Mid-Atlantic owner Robert Powell say that their client is one of those people but that he was pressured by the judges to make payments. The attorneys say Powell never offered to pay the judges, never sought to influence any juvenile case and is now cooperating with the investigation. Zappala and Powell were partners until Zappala bought out Powell in 2008.

Senior Judge Arthur E. Grim of Berks County is reviewing the cases for minors who appeared before Ciavarella. Court officials say some children may have their records expunged or be granted new hearings.

The Philadelphia Bar Association has expressed outrage, assuring the public that the rest of the judges on the state's bench are "composed of highly qualified, honorable and honest people, who take their responsibilities to the public very seriously."

But some of the children -- many who, like Phillip Swartley, are now young adults -- have become jaded and believe that their cases were tainted in Ciavarella's courtroom.

After being sent to boarding school, Phillip, now 15, became withdrawn and depressed, his mother says.

"What do these kids see of the legal system and of authority figures?" Amy Swartley asked. "These kids see people who abuse their power. Now, we have a whole county and generation of children who have lost trust in the system."