The builder of two private juvenile-detention centers at the heart of the "kids for cash" corruption case has agreed to pay $17.75 million to settle all civil-rights claims that resulted from the scandal, lawyers said Friday.

Robert K. Mericle's construction company built the for-profit detention facilities that replaced the Luzerne County detention center. Mericle and Robert Powell, who co-owned the centers, paid several million dollars to two county judges, one of whom sentenced juveniles to the facilities from 2003 to 2008.

Thousands of those juvenile convictions were thrown out by the state Supreme Court, which said the "taint" of the payments left the high court without any confidence that the judge adjudicated the cases in a fair and impartial manner.

That former judge, Mark A. Ciavarella Jr., was sentenced in August to 28 years in prison. Besides taking money, Ciavarella ruled capriciously, often within minutes and without benefit of counsel for the children.

Mericle, 48, of Luzerne County, who has a degree from the Wharton School, pleaded guilty in 2009 to failing to report a felony and faces up to three years in prison.

The settlement, which was filed in federal court Friday and must be approved by a judge, ends all claims by juveniles and the parents of juveniles against Mericle and his company, Mericle Construction Inc.

"We are very pleased with the Mericle settlement and delighted that it will address the needs of the children affected by this matter," said Daniel Segal, one of the attorneys for the plaintiffs.

An attorney for Mericle said they were pleased to bring the matter to a conclusion.

The attorneys for the plaintiffs said Mericle will pay $17.75 million into a settlement fund. Mericle's company is suing its insurance carrier; if the lawsuit is successful, the plaintiffs could receive up to an additional $1.75 million.

Earlier this year, Mericle's companies reportedly sold properties worth a total of $90 million.

The plaintiffs' lawsuits against the former judges, Powell, and the private detention centers are continuing, the attorneys said.