PHILADELPHIA A day after an appellate court ruled that Msgr. William J. Lynn had been wrongly convicted of endangering children, Philadelphia prosecutors said Friday that they would seek to keep Lynn in prison while they appeal the decision.

"The decades-long inaction of Lynn put countless children in harm's way, and he is where he belongs - behind bars," said Tasha Jamerson, spokeswoman for District Attorney Seth Williams. "The appeal is not over, and probably won't be for many months or years."

Lawyers for Lynn, the former clergy secretary for the Catholic Archdiocese of Philadelphia, are due in court Monday to argue for his release on bail.

"This is someone who never should have been convicted," lead defense lawyer Thomas A. Bergstrom said Friday.

The decision on his freedom falls to Common Pleas Court Judge M. Teresa Sarmina, who last year presided over Lynn's trial, said he "enabled monsters in clerical garb . . . to destroy the souls of children," and sentenced him to three to six years in prison.

Convicted after a three-month trial last year, Lynn, 62, was the first Catholic church official in the country to be tried and imprisoned for covering up child sex-abuse by priests.

The monsignor has served 18 months of his term, mostly at the State Correctional Institution at Waymart, in northeastern Pennsylvania. He will not attend the bail hearing, his lawyer said.

In its unanimous ruling Thursday, the three-judge Superior Court panel said prosecutors and Sarmina had misapplied the state's child-endangerment law by claiming Lynn was criminally responsible because he supervised a priest, Edward Avery, when Avery sexually abused an altar boy in the mid-1990s.

The higher court said the law at the time applied only to people who directly supervised children, and called Sarmina's interpretation "fundamentally flawed."

"The plain meaning of the statute requires that, for a person who is not a parent or a guardian of the endangered child to be subject to criminal liability, he must at least be engaged in the supervision, or be responsible for the supervision," the opinion stated.

The law was broadened in 2007 to cover supervisors in positions like the one Lynn had.

The decision stirred mixed opinions across the region.

Outside St. John the Evangelist Church in Center City, several people leaving a Mass on Friday said they were pleased with the ruling, though none wanted to be identified.

As he left the church after praying the rosary, Joseph Harkins noted that the case represents more than just a court battle.

"As far as the conviction being overturned - that's the legal side. But [Lynn's] going to have to square with him," Harkins said, pointing to the church.

The ruling disappointed victim advocates, who said it sends a message that sexual predators are more valued than victims.

"We feel it is revealing and sad that Msgr. Lynn's defenders do not debate whether he allowed a predatory priest to have continued access to children," the Bryn Mawr-based Foundation to Abolish Child Sex Abuse said. "Instead they quibble about whether the law applies to him."

Lynn's lawyers have argued all along that the monsignor was not properly charged in the landmark case. The child-endangerment law that was in effect when Lynn was secretary for clergy assigned responsibility only to direct caretakers, such as parents or guardians, and in arguments before Sarmina, lawyers asked that the charges be dismissed on that ground.

Sarmina rejected their arguments before and after the trial, and affirmed her decision in a 235-page opinion. She also rejected Lynn's requests for bail before his sentencing and during his appeal.

Alan J. Tauber, a lawyer on Lynn's defense team, said the monsignor should have been granted bail after sentencing. From the beginning, the attorneys believed he had a better-than-average chance at winning his appeal.

"This was, at best, a novel application of the law," Tauber said.

Lynn deserves bail now because he has deep community ties, a good prison record, and poses no flight risk, and because of the strength of the new ruling, Tauber said.

"It would be wholly unjustified to hold someone who has been exonerated," he said.