Msgr. William J. Lynn, the first Roman Catholic Church official convicted in the United States for covering up child sex abuse by priests, wants out of prison and to have his case assigned to a new judge.

A day after a Pennsylvania Superior Court panel overturned - for a second time - the 64-year-old's 2012 conviction, his lawyer, Thomas A. Bergstrom, sought an emergency bail hearing for his client and the removal of Common Pleas Court Judge M. Teresa Sarmina from the case.

In court filings Wednesday, Bergstrom cited Sarmina's "previous harsh sentence and other rulings," as well as her decision to admit evidence at trial of decades worth of child-abuse complaints involving Philadelphia area priests, some of which predated Lynn's tenure as secretary for clergy for the Philadelphia Archdiocese.

Superior Court called that evidence "unfairly prejudicial" in its ruling Tuesday and sided with Lynn's argument that it effectively turned him into a scapegoat for the wider sins of the church. Prosecutors had argued it offered insight into Lynn's decision-making, and shed light on the archdiocese's historic practice of covering up abuse to protect the interests of the church.

District Attorney Seth Williams remained silent Wednesday on whether his office would appeal the order for a new trial or oppose Lynn's motion for bail.

But if the past is any indication, prosecutors are likely to put up a fight.

When Superior Court last overturned Lynn's verdict and ordered his release in 2013 - finding he had been improperly charged under a law that did not apply at the time of his alleged crimes - prosecutors pushed to have Lynn held under house arrest at the rectory of St. William parish in Crescentville.

Less than a day after the Supreme Court reinstated Lynn's conviction earlier this year, Williams' office moved to have him put back behind bars.

Sarmina granted the request, Bergstrom wrote in his motion Wednesday, and issued other rulings that Lynn's legal team thought were unnecessarily harsh.

While he was on house arrest, Lynn asked permission to perform his niece's August 2014 wedding ceremony. Sarmina allowed the monsignor to attend, but refused to let him officiate.

Currently, Lynn remains housed in a state prison in Waymart, northeast of Scranton, having completed more than three years of his three- to six-year term.

As the archdiocese's secretary for clergy from 1992 to 2004, Lynn was responsible for investigating sexual abuse complaints made against priests and recommending punishment to the archbishop.

After a 13-week trial, jurors found that Lynn allowed the Rev. Edward V. Avery, who had a history of sexually abusing children, to live in a Northeast Philadelphia rectory, where he later assaulted a 10-year-old altar boy.

Avery pleaded guilty to the 1999 attack and is serving five years in prison.

215-854-2608 @jeremyrroebuck