A Brooklyn judge has been slapped by the Commission on Judicial Conduct, which issued an “admonishment” against him Tuesday for threatening prosecutors with a mistrial if they re-arrested a defendant who threatened a witness after she took the stand against him.

Gary first unlawfully sealed the courtroom when Bartholomew was arrested, giving no reason.

Then, after the rapist’s ex gal pal took the stand against him, the then 38-year-old–who was out on $100,000 bond– approached her and hissed “You’re dead.”

The terrified woman reported the threat to the ADA, who immediately relayed the information to the jurist.

But the judge threatened to dismiss the rape case if prosecutors arrested Bartholomew on a new menacing charge before the trial wrapped.

When Brooklyn Assistant DA Lisa Nugent pushed back, reminding the judge that her office had “no control over the police department,” the testy jurist exploded.

“Don’t give me any BS about you having no control over the police department!” Gary snapped, according to newly released court documents.

ADA Nugent then requested the judge remand Bartholomew, but Gary ignored her and the trial resumed.

The next day, the judge icily addressed the prosecutors.

“If there is a mistrial, if this case has to be delayed because you have unnecessarily and unjustifiably prevented the defendant from seeing his attorney and preparing his defense and this matter has to be adjourned, I will consider, one, financial sanctions against your office, and number two, I will certainly consider a mistrial with prejudice,” he spat.

Ultimately, the NYPD opted not to arrest the defendant mid-trial.

Bartholomew was later convicted, and sentenced to 15 years in prison. He later charged with menacing for the death threat, but the DA’s office declined to prosecute.

The perv will be eligible for parole in 2026.

“The police and prosecutors were appropriately doing their jobs by following up on an apparent threat to a witness by the defendant in a rape trial,” the Commission wrote Tuesday in its wrist-slap admonition, which constitutes nothing more than an official scolding.

“Judge Gary now recognizes that his heavy-handed attempt to thwart them was wrong,” the order reads. “Indeed, his vow to dismiss the rape charge “with prejudice” – meaning no retrial – would have compromised the integrity of the trial process he says he was trying to protect.”

Gary’s term expires on Dec. 31, 2020.

Neither the jurist, nor his attorney Harvey Greenberg, immediatley returned a call for comment.