In reversing the conviction, the Pennsylvania Superior Court ruled that prosecutors had provided “more than adequate” evidence that Monsignor Lynn “prioritized the archdiocese’s reputation over the safety of potential victims of sexually abusive priests.” But it rejected the argument, accepted at the trial, that the child welfare law applied to a “parent, guardian or other person supervising the welfare of a child” could be used to prosecute Monsignor Lynn.

Monsignor Lynn has served about 18 months of a three- to six-year prison sentence. His lawyer, Thomas Bergstrom, said he was expected to be freed on Thursday or Friday. He was granted bail pending an appeal to the State Supreme Court by the Philadelphia district attorney’s office, which must be filed by late January.

Defense lawyers argued during the trial that Monsignor Lynn was not properly charged under the original version of the child welfare law, which applied only to direct caretakers like parents or guardians. The law was updated to cover supervisors in 2007, after the monsignor left his post.

Judge Sarmina, who presided over Monsignor Lynn’s trial, said on Monday that she had given the case careful consideration in light of the appeals court’s ruling. “I may have got it wrong,” she said in a statement at the start of the bail hearing. “After all, I’m fallible. If the conviction is in question, is not the punishment in question?”