Justices in New York’s highest court heard arguments Thursday in the corruption case of a former Nassau police official, with his lawyer saying the conduct that led to his 2013 conviction was not a crime.

William Flanagan is seeking to overturn his misdemeanor conviction on two official misconduct counts and a conspiracy charge. The case involved a 2009 burglary of more than $10,000 in electronics from John F. Kennedy High School in Bellmore.

Prosecutors contend Flanagan, who retired in 2012 as second deputy police commissioner, abused his authority to get police to return the equipment and try to quash the arrest of student Zachary Parker as a favor to his father, Gary Parker.

They’ve said the father — a friend and donor to police causes — repaid Flanagan with steakhouse gift cards and a state-of-the art flashlight. Two other Nassau police officials pleaded guilty to official misconduct in the case.

Defense attorney Donna Aldea told the Court of Appeals Thursday it wasn’t illegal for police to return stolen property to an owner, and according to Flanagan’s indictment, that was “the only unauthorized act.”

“If you have an authorized act, which is what we have here ... then you don’t have one of the elements of the statute satisfied,” the Garden City lawyer said, adding that the government was using the official misconduct statute to criminalize someone for thoughts, not actions.

advertisement | advertise on newsday

Chief Judge Janet DiFiore asked Aldea what allowed Flanagan “to be involved, to halt any forward movement on that investigation?“

Aldea replied that those in charge of such an arrest were “never within his chain of command,” and prosecutors never offered proof Flanagan “ordered a non-arrest.”

But Nassau prosecutor Yael Levy said there was “plenty of evidence” Flanagan did just that. Prosecutors say Flanagan broke the law because he arranged to return the electronics “for a corrupt purpose.” Levy said Flanagan “stepped into a case where he had no business stepping in.”

“This defendant had unambiguous notice that it was unauthorized to return this property . . . I’m saying it was unauthorized in this scenario because of the purpose for which it was undertaken,” Levy said.

She drew a parallel with New Jersey’s Bridgegate scandal, saying closing road lanes is generally authorized, but when meant to punish a rival, becomes unauthorized. Levy also said the school’s principal made her desire for an arrest known “again and again.”

A court official said a decision is expected in the next several weeks. Flanagan’s sentence of 60 days in jail and community service is on hold in the meantime.