A Massachusetts judge and court officer have been indicted on federal charges of helping an illegal immigrant sneak out of the back of a courthouse to evade arrest by federal immigration officials.

Judge Shelley Joseph, 51, and then-trial court officer Wesley MacGregor, 56, were indicted in Boston federal court on obstruction of justice charges for preventing a U.S. Immigration and Customs Enforcement officer from arresting the unnamed defendant.

A senior immigration official based in Boston said in a statement to the Washington Examiner the judge's actions were "a detriment to the rule of law" and "highly offensive" to federal officers who are tasked with enforcing laws and court orders.

“In order for our criminal justice system to work fairly for all people, it must be protected against judicial officials who would seek to replace the implementation of our laws with their own ideological views or politically-driven agenda," Todd M. Lyons, acting field office director for the Boston office of ICE enforcement and removal operations, wrote.

Court documents show police in Newton, Mass., arrested and charged an illegal immigrant in March 2018 with narcotics possession and being a fugitive from justice. The defendant had been deported twice before and had a federal order against him barring his entrance into the United States until 2027.

When immigration officials learned that the man was arrested, it issued an order that he be detained and removed from the U.S.

Boston is a de facto sanctuary city, which means local law enforcement have been instructed by city officials not to honor federal requests from ICE to hold wanted individuals for up to 48 hours so that they can be transferred to federal custody and begin removal proceedings.

In April, the man appeared in Newton District Court and an ICE officer was dispatched to execute a warrant and arrest the defendant. The officer alerted Joseph and other courthouse officials of his presence, but was told to leave the courtroom and wait in the lobby in anticipation of detaining the man.

But that detention did not go as planned, according to the Justice Department.

Joseph, the defense attorney, and the assistant district attorney were captured on courtroom audio discussing the immigrant and the ICE officer’s presence at the courthouse. Joseph then violated district court rules and told the clerk to turn off the audio recorder. The recorder was turned off for 52 seconds and when it was turned back on Joseph indicated that she would release the man.

According to the indictment, the defense attorney then asked to speak with the man downstairs, which Joseph said was fine. When Joseph was reminded that an ICE officer was in the courthouse, she responded, “That’s fine. I’m not gonna allow them to come in here. But he’s been released on this.”

After the proceeding, MacGregor escorted the defendant, his defense attorney, and an interpreter downstairs and used his security pass to open a rear sally-port exit, allowing the man to escape, the indictment stated.

U.S. Attorney Andrew E. Lelling said that people in the justice system “can’t pick and choose” the laws they follow or use “personal views to justify violating the law.”

“This case is about the rule of law,” Lelling said. “The allegations in today’s indictment involve obstruction by a sitting judge, that is intentional interference with the enforcement of federal law, and that is a crime.”