PHILADELPHIA (AP) — A Roman Catholic church official who has been jailed for more than a year for his handling of priest sex-abuse complaints had his landmark conviction reversed and was ordered released Thursday.

A three-judge Superior Court panel unanimously rejected prosecution arguments that Monsignor William Lynn, the first U.S. church official ever charged or convicted for the handling of clergy-abuse complaints, was legally responsible for an abused boy's welfare in the late 1990s.

"He's been in prison 18 months for a crime he didn't commit and couldn't commit under the law," said his attorney, Thomas Bergstrom. "It's incredible what happened to this man."

Lynn, 62, is serving a three- to six-year prison sentence after his child-endangerment conviction last year. His lawyers hoped for his immediate release Thursday from the state prison in Waymart, but the appeals court denied the request, instead sending the bail issue back to the trial court.

Prosecutors vowed to oppose bail and to challenge the 43-page opinion.

"Because we will be appealing, the conviction still stands for now, and the defendant cannot be lawfully released until the end of the process," District Attorney Seth Williams said in a statement.

His office contended at trial that Lynn reassigned known predators to new parishes in Philadelphia while he was the archdiocese's secretary for clergy from 1992 to 2004. Lynn's conviction stems from the case of one priest, Edward Avery, found to have abused a child in 1998 after such a transfer.

Victims' groups blasted the reversal.

"We know thousands of betrayed Catholics and wounded victims will be disheartened by this news," said David Cloches', director of the Survivors Network of those Abused by Priests.

Lynn's attorneys have long argued that the state's child-endangerment law at the time applied only to parents and caregivers, not supervisors like Lynn. Common Pleas Judge M. Teresa Sarmina had rejected their argument and sent the case to trial.

Story continues

Sarmina concluded that Lynn perhaps drafted a 1994 list of accused priests to try to address the clergy abuse problem. But when Cardinal Anthony Bevilacqua had the list destroyed, Lynn chose to stick around — and keep quiet, she said. A copy of the list was found years later in a safe and was repeatedly shown at trial.

Sarmina, in sentencing Lynn in July 2012, had said the church administrator had "enabled monsters in clerical garb ... to destroy the souls of children," rather than stand up to his bishop.

Lynn told the judge: "I did not intend any harm to come to (the boy). The fact is, my best was not good enough to stop that harm."

Lynn's supporters believe he was made a scapegoat for the church's sins. Nonetheless, Bergstrom said his client hopes to return to ministry, and has enjoyed support of the current Philadelphia archbishop, Charles J. Chaput, who twice visited him in prison.

Lynn had left the archdiocesan hierarchy for parish work after he featured prominently in a damning 2005 grand jury report into the priest-abuse scandal. Then-District Attorney Lynne Abraham concluded that too much time had passed to charge anyone criminally despite decades of abuse complaints against dozens of priests.

Williams, her successor, revisited the issue when new accusers came forward under new laws that extended the time limits and added church or school supervisors to the list of people who could be charged. Williams filed the novel child-endangerment case against Lynn, while charging three other priests and a teacher of sexually abusing children.

Three of them have been convicted while the jury deadlocked in the fourth case.

Lynn's trial lasted several months, although a majority of the testimony involved victim testimony from earlier, uncharged priest-abuse cases, much of it graphic. Sarmina allowed the jury to hear that evidence to let prosecutors show the pattern of behavior by Lynn and other church officials.

Bergstrom had also challenged that decision on appeal, calling it unfair.

The Superior Court never addressed that concern or other alleged trial errors, concluding the charges themselves were flawed because Lynn was charged under an endangerment law adopted after he left his church post.

The court found that Lynn didn't supervise Avery's accuser and "did not have any specific information that Avery intended or was preparing to molest (the boy) or any other child."

The archdiocese said in a statement that its handling of abuse complaints "has changed dramatically since the events over 10 years ago that were at the center of the trial." Over the past two years, Chaput has turned over sex-abuse complaints to prosecutors, and ousted at least nine accused priests from ministry, while restoring others to their jobs after finding complaints unfounded.

The archdiocese has called the sentence excessive and noted Thursday that it had hoped that Lynn's sentence would be reviewed.

"We recognize that today's news is especially difficult for survivors and their families. We profoundly regret their pain," the archdiocese said.