The former Brooklyn judge who said he wrongfully convicted a man of murder because of his own anti-white bias said Thursday that he felt “terrible” when he saw the condition of the guy in court this week.

“He’s a shell of a man,” former state Supreme Court Justice Frank Barbaro told The Post, the day ­after he gave bombshell testimony in a bid to overturn Donald ­Kagan’s conviction.

Before Kagan went to jail, “he was strong, robust, nice rosy cheeks — and [this time] he looked like a skeleton, you could see his cheekbones” at Wednesday’s hearing, Barbaro said.

“And he had a scowl on his face — that really got to me. He was very angry,” Barbaro added.

Barbaro said he tried to catch Kagan’s eye as he left the witness stand in Brooklyn Supreme Court, but the bitter jailbird — who is serving 15 years to life in the slammer for the slaying — “was just looking straight ahead.”

“I wanted to say to him: ‘I’m sorry. I want to do whatever I can, whatever it takes to get you out of jail,’ ” Barbaro said during an ­interview at his home in upstate Watervliet, near Albany.

Donald Kagan

Barbaro insisted that he rejected what he now calls Kagan’s valid self-defense claim because he misinterpreted key testimony when Kagan took the stand at his non-jury trial in 1999.

Barbaro said he thought he heard Kagan, who is white, recall saying, “You want some of this? Come and get it” before he fatally shot Wavell Wint, who was black, outside an East New York movie theater in 1998.

Kagan actually told Wint, “You don’t want any of this,” during the struggle over Kagan’s chain, Barbaro claims, suggesting that the suspect was actually trying to ­defuse the situation.

Still, a review of the judge’s original opinion in the case, written in 1999, shows that Barbaro had gotten the quote right at the time. He actually refers to it in his opinion.

Kagan’s lawyer and prosecutors will argue over whether his ­conviction will be overturned at a hearing on Jan. 30.

Brooklyn state Supreme Court Justice ShawnDya Simpson must then decide whether to acquit ­Kagan, grant him a new trial or let his conviction stand.

Even without the murder conviction, Kagan would have served 10 years for illegally possessing the handgun he used to kill Wint.