SCRANTON - A federal judge has given final approval to a settlement that will pay nearly $18 million to juveniles who allege they were wrongly incarcerated by corrupt judges in Luzerne County.

The approval granted Friday by U.S. District Judge A. Richard Caputo in Scranton allows attorneys to begin distributing money to about 1,600 teens and parents caught up in the so-called kids-for-cash scandal.

The funds come from real estate developer Robert K. Mericle, who built a pair of for-profit youth detention facilities that replaced the Luzerne County detention center. Two county judges accepted more than $2 million in payments from Mericle and regularly jailed teens at the facilities.

Most affected young people will receive $500 to $5,000, though some will get more based on the circumstances of their incarceration; parents will be reimbursed for court costs and fines ordered by the now-disgraced judges.

About $4.3 million of the settlement, which was agreed to last year but was awaiting approval just granted by the federal judge, will go toward attorneys' fees.

The Pennsylvania Supreme Court dismissed about 4,000 juvenile convictions issued by Judge Mark Ciavarella after authorities found he repeatedly tried children without lawyers and often jailed them for months at Mericle's facilities, sometimes for petty offenses.

Federal prosecutors accused Ciavarella and a second judge, Michael T. Conahan, of receiving money from Mericle and of extorting hundreds of thousands of dollars from Robert Powell, the co-owner of the detention centers.

Powell is serving 18 months in prison for failing to report a felony. Mericle pleaded guilty to the same offense; he has not yet been sentenced.

Ciavarella was sentenced to 28 years in prison but is appealing, contending the judge in his trial expressed "complete sympathy" with people outraged by the case. Ciavarella's lawyers challenged the impartiality of U.S. District Judge Edwin Kosik in an appeals hearing in Philadelphia last month, but no ruling has been made.

Kosik sentenced Conahan to 171/2 years. Conahan has petitioned to be resentenced before a different judge if Ciavarella wins his appeal on the Kosik issue.