A Pennsylvania court has overturned the conviction of Monsignor William Lynn, the first senior U.S. Catholic Church official to be found guilty of covering up child sex abuse by a priest, and ordered him to be freed from jail on Thursday.

Monsignor Lynn was convicted in June 2012 of endangering the welfare of a child by assigning a priest with a history of sexual abuse to a Philadelphia parish that was unaware of his past.

That priest, Edward Avery, later pleaded guilty to sexually assaulting a 10-year-old altar boy in the Philadelphia parish. Lynn, who was not accused of personally molesting children, was sentenced to a three-to-six-year prison term.

A unanimous Superior Court of Pennsylvania appeals panel reversed Lynn's conviction and ordered him discharged from prison, saying the case was "not supported by sufficient evidence."

The New York Times reports that the June 2012 conviction on one count of child endangerment with a sentence of three to six years in prison was lauded by victim advocates as an overdue assignment of responsibility to senior church officials.

Lynn’s supporters felt the sentence was overly harsh for a man who made misjudgments but who was ultimately following the orders of an archbishop, who has since died.

Lynn's attorney, Thomas Bergstrom, said the ruling demonstrated Lynn should never have been prosecuted and added that he expects Lynn to be released within days.

Philadelphia District Attorney Seth Williams said in a statement he would most likely appeal.

Lynn served as secretary for clergy for the Philadelphia Archdiocese from 1992 to 2004 and, in that role, had access to the archdiocese's secret archives - a repository of information on infractions by its priests - according to the court papers.

While not empowered to reassign or remove priests, Lynn was charged with passing information to higher church authorities.

In a statement posted on its website, the archdiocese said it had taken steps to assure the safety of children in its care.

"The decision by the Superior Court to overturn this conviction does not and will not alter the Church's commitment to assist and support the survivors of sexual abuse on their journey toward healing or our dedicated efforts to ensure that all young people in our care are safe," it said.

But the advocacy group, the Survivors Network of those Abused by Priests (SNAP), offered a less optimistic perspective.

"Once again, another high-ranking Catholic official who repeatedly endangered kids and enabled predators is escaping punishment," SNAP said in a statement. "If kids are to be safer, we need to hold employers more responsible, not less responsible, for putting innocent children in harm's way."