A former juvenile court judge in Pennsylvania was sentenced to 28 years in prison on Thursday for his part in an alleged “kids for cash” scam considered one of the worst judicial scandals in US history.

Mark Ciavarella Jr., 61, a former judge in Luzerne County, was also ordered to pay $1.17 million in restitution.

Mr. Ciavarella was convicted in federal court in Scranton, Pa., in February on charges that he and a second judge, Michael Conahan, ran the local court system as a racketeering enterprise.

The federal indictment says the two judges accepted $2.8 million in kickbacks from the owner and builder of two privately-run juvenile detention facilities. In exchange, the judges agreed to close down the county’s own juvenile detention center, which would have competed with the new, privately-run facilities. In addition they guaranteed that juvenile offenders from their court would be directed to the privately-run facilities.

Mr. Conahan, pleaded guilty last year to a single count of racketeering and is awaiting sentencing.

In comments to the court, Ciavarella apologized to the community and to the children whose cases he had adjudicated. “I blame no one but myself for what happened,” he said, according to the Associated Press.

But the former judge rejected claims that he engaged in a "kids for cash" racketeering scheme.

He said prosecutors used the claim to sabotage his reputation prior to his trial. “Those three words made me the personification of evil,” he told the court, according to the Associated Press. “They made me toxic and caused a public uproar the likes of which this community has never seen.”

Ciavarella had a reputation as a no-nonsense jurist who would not hesitate to sentence young, first-time offenders to juvenile detention. He also gained a reputation as a judge prone to cut constitutional corners.

An investigation revealed that half of the children who appeared in his courtroom were not represented by a lawyer and were never advised of their right to counsel. Of those unrepresented children, up to 60 percent were ordered by Ciavarella to serve time at a detention facility.

What was not known, prior to the federal investigation, was that Ciavarella and Conahan were receiving secret payments from the private detention centers. The centers stood to profit from the higher number of juveniles they were housing.

Amid mounting questions about Ciavarella’s actions as a juvenile judge, the Pennsylvania Supreme Court in 2009 directed that all adjudications involving children appearing before Ciavarella from 2003 to 2008 be vacated and their records expunged. The directive is estimated to involve 4,000 cases.

One of those cases involved 16-year-old A.A., who was arrested for gesturing with her middle finger at a police officer who had been called during a custody dispute involving her parents and her sister.

According to a 2010 report of the Interbranch Pennsylvania Commission on Juvenile Justice, A.A. was an honor roll student, a Girl Scout, and YMCA member, who attended bible school. She had no prior arrest record and had never even been in detention in school.

She was sent to Ciavarella’s court, and was told she wouldn’t need a lawyer since it was a minor issue.

After examining the paperwork, Ciavarella informed A.A. that she had no respect for authority. She later told the investigating commission that Ciavarella never gave her an opportunity to speak at the hearing. She was led out of the courtroom in shackles and held in juvenile detention for six months.

After her release, A.A. returned to school and, again, qualified for the honor roll. She is currently in college and plans to pursue a law degree. She told the investigating commission that she wants to defend the legal rights of children.

Ciavarella was convicted of 12 of 39 counts in his indictment. The jury found him guilty of engaging in a pattern of racketeering and participating in a racketeering conspiracy through his receipt and transfer of $997,600 from individuals associated with the juvenile detention centers.

He was also convicted of failing to record the secret payments on judicial financial disclosure forms from 2004 to 2007, and for filing false tax returns for those same years. In addition, the jury found him guilty of engaging in a money-laundering conspiracy to conceal the payments.

Prosecutors requested a life sentence.

In his sentencing memorandum, Ciavarella’s lawyer, Albert Flora, urged US District Judge Edwin Kosik to issue a sentence on the lower end of the guidelines range.

“If Mark Ciavarella never did one day of incarceration, he would still be punished,” Mr. Flora wrote. He said the former judge had been subject to “embarrassment, ridicule, and shame out of proportion to the offense.”

“The media attention to this matter has exceeded coverage given to many and almost all capital murders, and despite protestations, he will forever be unjustly branded as the ‘Kids for Cash’ judge,” Flora wrote.

Ciavarella has insisted that the money he received was not a bribe. He said it was a finder’s fee legally paid to him for introducing the owner of the detention center business to a builder who was later awarded the contract to build the juvenile centers. Ciavarella says there was never a quid pro quo of providing juvenile offenders in exchange for money.

Judge Kosik rejected this reasoning while calculating Ciavarella’s sentence.

“Defendant argues that the government planted a seed of the kids for cash idea without proof that the defendant sent kids away for cash,” Kosik said in a pre-sentence ruling. “While there was no evidence of the number of kids put away, there was evidence of the defendant’s financial interest [in the construction and operation of the juvenile detention centers],” the judge wrote.

At trial, a co-owner of the juvenile detention business, Robert Powell, testified that Ciavarella kept a record of the number of children he sent to the facility, as well as the amount of money the owners were making. According to court documents, Ciavarella allegedly told Mr. Powell: “…so it’s not about me sending kids anymore. I know how much money you’re making, and it’s time to step up.”