The highest court in Massachusetts has publicly rebuked a district court judge over her role in a case involving an illegal immigrant who evaded arrest by Immigration and Customs Enforcement.

For Judge Shelley Joseph, the decision brings to a close a legal saga that began on April 2, 2018, when Jose Medina-Perez left the Newton District Court through a rear courthouse exit all while an ICE officer was waiting in the lobby to take him into custody.

The Supreme Judicial Court's ruling centered on a sidebar with Medina-Perez's attorney and the prosecutor during which Joseph instructed her clerk to shut off the courtroom's recording system.

"The respondent's statements during that conversation, including her proposal to detain Medina-Perez overnight in State custody, and her conduct in instructing the clerk to turn off the courtroom audio recording system, created an appearance of impropriety in violation of her duties," according to the Thursday ruling from the Supreme Judicial Court.

FORMER WISCONSIN JUDGE HANNAH DUGAN AVOIDS JAIL TIME FOR OBSTRUCTING ARREST OF ILLEGAL IMMIGRANT

The Supreme Judicial Court's reprimand came after a hearing officer for the Commission on Judicial Conduct recommended such an action.

However, the high court ruled that Joseph was unaware Medina-Perez's attorney, David Jellinek, had devised a plan to help his client evade ICE by escorting him to the courthouse lockup, where the court officer would release him through a rear sally port exit. The court also found that Joseph neither explicitly nor implicitly approved of that plan.

Medina-Perez, of the Dominican Republic, had been in Joseph's courtroom to be arraigned on a fugitive-from-justice charge that originated in Pennsylvania.

Joseph found there wasn't enough evidence to tie Medina-Perez to the Pennsylvania warrant, and prosecutor Shannon Jurgens recommended he be released without bail on two drug charges he was facing.

FEDERAL JUDGE IN NEW YORK TIES TRUMP ADMIN HANDS ON ARRESTS AT IMMIGRATION COURTS

Joseph then released Medina-Perez on his own personal recognizance and set a pre-trial conference date for the drug possession case.

In April 2019, roughly a year later, Joseph and the court officer who let Medina-Perez out through the back door were indicted on charges of obstruction of justice.

That case was dropped in 2022 after Joseph agreed to refer herself to the Commission on Judicial Conduct, the agency that investigates allegations of misconduct by Massachusetts judges.

The commission concluded that Joseph "engaged in willful judicial misconduct that brought the judicial office into disrepute, as well as conduct prejudicial to the administration of justice and unbecoming a judicial officer."

After her federal indictment, Joseph was suspended from the bench and unable to work for three years.

Joseph's attorney, Elizabeth Mulvey, said last year during a commission hearing that the case had been distorted in the media, with many coming to believe that her client "let an illegal immigrant out of the door," according to The Associated Press.

In a statement to the AP on Thursday, Mulvey said it has been an "incredibly long and difficult eight years for Judge Joseph."

"We are grateful to the hearing officer who undertook this monumental task and pleased that his efforts have shown that this was a baseless federal prosecution from the beginning and solely the work of the defense lawyer involved," Mulvey said in a statement. "Judge Joseph is thankful for everyone who stood by her and looks forward to rejoining her colleagues."

Joseph, who remains a judge, was assigned in December to administrative duties in the Boston Municipal Court.