The state’s highest court has given two bad judges the boot — including one who was collecting her $175,000-a-year tax payer-funded salary from jail.

Rochester City Court Judge Leticia Astacio — who court officials said was getting paid last year while locked up for violating her parole for a DWI conviction — and Queens Civil Court Judge Terrence O’Connor, who referred to state officials investigating his behavior as a “f–king clown show,” lost their jobs Tuesday following separate rulings from the Court of Appeals.

In February 2016, cops found Astacio behind the wheel of her car on the side of the highway around 8 a.m.

She reeked of alcohol and refused a Breathalyzer while telling police, “You’re ruining my f–king life,” according to reports.

She then failed to complete a sobriety test in a timely fashion during probation because she was in Thailand, according to the state Commission ion on Judicial Conduct.

She had asked the state’s high court to give her a rebuke instead of terminating her — arguing that her probation didn’t prohibit international travel.

But the panel opted for her ouster.

Seven senior judges said Astacio “ignored multiple warnings about the consequences of her continued drinking” and lacked insight “into the gravity and impact of her behavior on both public perception of her fitness to perform her duties and on the judiciary overall.”

O’Connor — censured in 2013 for outside work — had refused to testify under oath at a disciplinary hearing in March 2017, according to the Judicial Conduct panel.

After the hearing two staffers heard O’Connor gripe, “This place is a f–king clown show” before storming out.

The $193,500-a-year housing court judge was disciplined for tossing two cases because he didn’t like how the lawyers answered questions with the reply, “OK,” the commission’s report said.

He’d also publicly lambasted three different attorneys who appeared before him, including a rookie lawyer who made the mistake of texting his boss when O’Connor unexpectedly ordered him to try a case.

“Is there some course in law school now, how to be discourteous and how to be rude? Because if there is, you must have gotten an A in it,” O’Connor barked to the rookie.

O’Connor also challenged his removal claiming his conduct was justified given the “rough tumble” nature of landlord-tenant litigation. The panel didn’t buy his excuse.

The senior judges said his comments in “open court were intemperate and inconsistent with appropriate judicial demeanor.”

“His conduct was significantly compounded by his persistent failure to cooperate” with officials at disciplinary proceedings, they ruled.

O’Connor’s attorney declined to comment. Astacio’s lawyer did not return a message.