Updated

A longtime northeastern Pennsylvania judge was ordered to spend nearly three decades in prison for his role in a massive juvenile justice bribery scandal that prompted the state's high court to toss thousands of convictions.

Former Luzerne County Judge Mark Ciavarella Jr. was sentenced Thursday to 28 years in federal prison for taking $1 million in bribes from the builder of a pair of juvenile detention centers in a case that became known as "kids for cash."

Ciavarella was motionless when the decision was announced and had no reaction. From behind him, where family members of some of the children he sentenced sat, someone cried out "Woo hoo!"

In the wake of the scandal, the Pennsylvania Supreme Court tossed about 4,000 convictions issued by Ciavarella between 2003 and 2008, saying he violated the constitutional rights of the juveniles, including the right to legal counsel and the right to intelligently enter a plea.

Ciavarella, 61, was tried and convicted of racketeering charges earlier this year. His attorneys had asked for a "reasonable" sentence in court papers, saying, in effect, that he'd already been punished enough.

"The media attention to this matter has exceeded coverage given to many and almost all capital murders, and despite protestation, he will forever be unjustly branded as the 'Kids for Cash' judge," their sentencing memo said.

Al Flora, Ciavarella's lawyer called the sentence harsher than expected. Ciavarella surrendered immediately but it was not immediately known where he would serve his sentence.

Ciavarella, speaking before the sentence was handed down, apologized to the community and to those juveniles that appeared before him in his court.

"I blame no one but myself for what happened," he said, and then denied he had ever incarcerated any juveniles in exchange for money.

He also criticized U.S. Assistant Attorney Gordon Zubrod for referring to the case as "kids for cash," and said it sank his reputation.

"He backdoored me, and I never saw it coming. Those three words made me the personification of evil," Ciavarella said. "They made me toxic and caused a public uproar the likes of which this community has never seen."

Zubrod said that Ciavarella had "verbally abused and cruelly mocked children he sent away after violating their rights." He called the ex-judge "vicious and mean-spirited" in asking U.S. District Judge Edwin M. Kosik for a life sentence.

Federal prosecutors accused Ciavarella and a second judge, Michael Conahan, of taking more than $2 million in bribes from the builder of the PA Child Care and Western PA Child Care detention centers and extorting hundreds of thousands of dollars from the facilities' co-owner.

Ciavarella, known for his harsh and autocratic courtroom demeanor, filled the beds of the private lockups with children as young as 10, many of them first-time offenders convicted of petty theft and other minor crimes.

The judge remained defiant after his arrest, insisting the payments were legal and denying he incarcerated youths for money.

The jury returned a mixed verdict following a February trial, convicting him of 12 counts, including racketeering and conspiracy, and acquitting him of 27 counts, including extortion. The guilty verdicts related to a payment of $997,600 from the builder.

Conahan pleaded guilty last year and awaits sentencing.