An appellate court has reversed a judge’s order telling Nassau prosecutors to release a convicted sex offender’s entire case file to him as he tries to prove his innocence decades after pleading guilty in a child sex abuse case.

In a decision Wednesday, the Brooklyn court reversed a 2013 state Supreme Court ruling that said the Nassau district attorney’s office had to give Jesse Friedman “every piece of paper” from his case except victims’ names.

Friedman, now 46 and living in Connecticut, pleaded guilty in 1988 to sexually abusing boys who took computer classes in his family’s Great Neck home. He spent 13 years in prison and has since claimed that police manipulated children into making false claims and that he took a plea to avoid facing life behind bars.

StorySex offender wants hearing on convictionStoryLawyers spar over sex offender's record

In its ruling, the appellate court — with one of the four justices dissenting — found prosecutors had met a burden of showing statements by nontestifying witnesses are confidential and not subject to disclosure under the state’s freedom of information law.

The ruling also found Friedman had failed to show a compelling need for disclosure of grand jury minutes, including why such records are needed to see if flawed interviewing techniques were used in the criminal probe.

Shams Tarek, a spokesman for acting District Attorney Madeline Singas, said in a statement that her office was “gratified that the court recognized that the statements of non-testifying witnesses are confidential.”

advertisement | advertise on newsday

“Jesse Friedman’s victims never testified in open court because he pleaded guilty, forfeiting his right to a public trial,” Tarek added.

Friedman’s attorney, Ronald Kuby, told appellate justices in February that state Supreme Court Justice F. Dana Winslow, who wrote the original decision and saw case documents that Friedman had not, found substantial differences in subsequent statements police took from witnesses as their criminal probe developed.

“The decision perpetuates the fiction that witnesses’ statements to the police are inherently confidential, even though the police do not, and cannot, make any such promise,” the Manhattan lawyer said a statement Wednesday. “Maintaining this secrecy makes it that much harder for the wrongfully convicted to clear their names and that much easier for prosecutors to conceal their misconduct.”

The 2003 documentary “Capturing the Friedmans” boosted Friedman’s effort to clear his name by raising questions about possible judicial bias and techniques police used to question child witnesses.

Separately, legal proceedings related to an innocence hearing that a judge granted last year have begun in a Nassau County court as Friedman tries to show he was wrongfully convicted.

“I was innocent in 1987 and I am innocent today,” Friedman said in a statement Wednesday that also said five children had recanted claims against him.

The innocence hearing follows a 2013 determination by the district attorney’s office that Friedman’s conviction was justified — a review that came after a federal court said evidence suggested a likelihood of a wrongful conviction.