CHICAGO (AP) — An Illinois judge who made sexist comments about an attorney during a conversation in his courtroom that he did not realize was being broadcast live on YouTube has been removed from the bench, officials announced Wednesday.

In an order released to the media, Cook County Chief Judge Timothy Evans said Judge William Raines is “hereby reassigned to restricted duties or duties other than judicial duties” and must “receive sensitivity training and gender bias counseling designed to address and remedy the alleged conduct.”

The order does not explicitly say how long Raines must remain off the bench, but it says another judge will “monitor and mentor” Raines and report back to the court system’s executive committee within 90 days.

He made the disparaging comments about attorney Jennifer Bonjean on Jan. 11 to two assistant state’s attorneys and an assistant public defender, just after Bonjean had left the courtroom.

“Can you imagine waking up next to her every day? Oh, my God!” Raines said, according to a transcript of the exchange. ”I couldn’t have a visual on that if you paid me.

Raines, whose court call was carried live as many hearings have been during the COVID-19 pandemic, apparently realized that his comments were still being broadcast and asked if his comments were streaming live. Then the video ends.

Bonjean was informed about the comments and later that week asked a judge to preserve the video so she could lodge a complaint with the state’s Judicial Inquiry Board, which reviews judicial misconduct allegations.

Evans also scheduled a hearing of the court’s executive committee that was held late Tuesday. In the order, he said Raines “expressed contrition” during the hearing for what had happened.

The order said Raines’ comments were likely a “violation of the Illinois Code of Judicial Conduct” and that the matter had been referred to the state’s Judicial Inquiry Board.

In a brief statement, Bonjean, who also appeared before the executive committee, said in a statement that she was “grateful that it took the complaint seriously and acted with alacrity.”

A prominent New York-based attorney, Bonjean has represented several high-profile clients in Chicago and around the United States, including Bill Cosby and men wrongfully convicted of murder and rape, did not immediately respond to a request for comment.