A panel of state appellate judges has upheld the misdemeanor convictions against the two ex-officers tried in last year’s notorious “Rape Cops” trial.

The ruling announced yesterday means Kenneth Moreno and Franklin Mata, who were acquitted of more serious rape and burglary charges, must serve jail sentences for three counts each of official misconduct — one for each time they re-entered a drunken woman’s East 13th Street apartment four years ago after first helping her home.

They could be jailed on their next court date, which has yet to be set, but their lawyers said they may take it to the state Court of Appeals.

Moreno, characterized as the lead officer in the misconduct, will serve a sentence of one year in prison, or seven months with good behavior. Mata will serve 60 days, or 40 days with good behavior.

Both had remained free following their May 2011 conviction pending yesterday’s decision.

The cops had been called in December 2008 to help the woman out of a cab and into her apartment in the East Village. After escorting her in, they repeatedly revisited the home. The woman said Moreno sexually assaulted her, and Mata was accused of acting as a lookout, but both were cleared of rape charges.

In appealing the misconduct convictions, their lawyers had argued that prosecutors failed to prove the cops received a specific benefit — such as cash or a meal — in re-entering the fashion executive’s home.

They also argued the DA misinstructed jurors during summations by telling them the benefit was the cops got to “hang out” at the home.

The appellate judges agreed in their decision that “in her summation, the prosecutor misstated the law regarding the ‘benefit’ element of official misconduct by suggesting that mere neglect of duty would qualify as a benefit.”

But that error did not warrant reversal, they wrote, given jurors were properly told by the trial judge, Manhattan Supreme Court Justice Gregory Carro, that the summations were not evidence and were given proper instructions on the law for official misconduct.

“We find that the verdict was based on legally sufficient evidence,” the judges wrote.

“To establish the crime of official misconduct, [prosecutors] had to prove that each defendant committed an act ‘relating to his office’ that constituted an ‘unauthorized exercise of his official functions,’ that he knew the act was unauthorized, and that he acted with the intent to obtain a benefit,” the judges wrote.

“An action taken by a public servant that is ‘completely unrelated to his [or her] position’ is not ‘within the scope of [his or her] real or apparent authority,’ ” they wrote.

“Defendants were police officers who initially responded to a taxi driver’s 911 call reporting an intoxicated passenger who was unable to get out of the cab. Defendants assisted the passenger in getting out of the cab and escorted her to her apartment,” they wrote.

“Although not assigned to do so, and while giving their command false information as to their whereabouts, defendants returned three additional times that night to the complainant’s apartment,” the judges wrote.

“While the events that occurred in the apartment are in dispute and were the subject of charges of which defendants were acquitted, the evidence establishes that each defendant’s intent was, at least, to socialize with the complainant with a view toward sexual intercourse, or to assist his partner in doing so.”