A Massachusetts judge has been indicted for helping an unauthorized immigrant avoid Immigration and Customs Enforcement officers in her own courthouse.

The U.S. Attorney’s Office in Boston released the indictment on Thursday, charging Judge Shelley Richmond Joseph with obstruction of justice. Federal prosecutors also secured the indictment of Wesley MacGregor, a court officer, for obstruction and perjury. The charges constitute a remarkable intrusion into the internal affairs of a state judiciary and possible retaliation against Massachusetts’ “sanctuary” policies. Rarely in modern history has the federal government sought to punish a state judge acting in exercise of judicial functions. This prosecution sends a clear threat to state courts around the country that do not want to be commandeered by ICE.

Thursday’s charges stem from an incident on April 2, 2018, when Joseph held an arraignment hearing for Jose Medina-Perez, who has resided in the United States unlawfully. Medina-Perez had been arrested on drug charges by police in Newton, Massachusetts, where Joseph presides. Prosecutors initially believed he also had an outstanding warrant for drunk driving. But on April 2, Assistant District Attorney Shannon Jurgens concluded that Medina-Perez was not the individual named in the warrant. She also declined to request that the state hold him the drug charges. So Joseph ordered him released.

That’s when the trouble began. Joseph and the attorneys were aware that a plainclothes ICE officer was present to arrest Medina-Perez once the hearing concluded; the judge had asked him to wait outside the courtroom. Before releasing him, Joseph held a sidebar with Medina-Perez’s attorney, David Jellinek. She asked Jellinek, “ICE is gonna get him?” She then asked him “What if we detain him?” Then she had the court recorder turned off for an “off the record” conversation, in apparent violation of the Massachusetts Rules of Court. After the recording resumed, Joseph ordered Medina-Perez released. MacGregor escorted him to a backdoor exit, avoiding the ICE officer just outside the courtroom. Medina-Perez left, successfully evading arrest.

Prosecutors allege that Joseph and MacGregor conspired to help the immigrant elude ICE, thereby obstructing justice. (They also claim that MacGregor lied to a grand jury during the ensuing federal investigation.) The indictment alleges that, when the recorder shut off, Joseph and Jellinek (who has not been charged) “discussed devising a way” to help Medina-Perez escape ICE, which had a detainer for his arrest.

Joseph’s case is certain to prompt an outcry from civil liberties advocates who oppose ICE’s aggressive invasion of state courthouses to seize immigrants suspected of lacking proper documentation. Newton is a “sanctuary city”—municipal law bars local officials from helping federal agents detain unauthorized immigrants. Moreover, Massachusetts is a partial “sanctuary state,” as the Supreme Judicial Court has ruled that state court officers cannot legally comply with ICE detainers. (These detainers, or “immigration holds,” direct officers to hold immigrants in custody until ICE can retrieve them.)

There is, however, a line between refusing to cooperate with ICE and actively obstructing ICE’s operations. Joseph and MacGregor are alleged to have crossed that line. It is gratifying to see that the Justice Department still believes that obstruction of justice can occur, but this case is a curious one to pursue.

Joseph will surely raise the defense of judicial immunity, since judges generally have absolute immunity for actions they take in their official capacity. For that reason, prosecutors are famously hesitant to charge judges for any exercise of their judicial function. To win this case, prosecutors may have to prove that Joseph did not engage in a judicial act when she allowed Medina-Perez to leave out the back door. But judges typically have the power to determine how an individual in custody is released, so the prosecution may prove to be an uphill climb. (Prosecutors will surely cite the fact that Joseph turned the court recorder off, in apparent violation of the court’s rules, as evidence that the judge knew she wasn’t acting in a lawful, official capacity.)

This case, then, appears deeply political—a warning to judges who, like Joseph, will not collude with ICE under any circumstances, and may even work to thwart ICE’s goals. Few, if any, contemporary legal disputes involve such a direct clash between federal and state authority; one might need to revisit the Fugitive Slave Act cases to locate a roughly analogous conflict between federal authorities and state courts. While the legal issues here are murky and complex, the message from the Justice Department is clear: State judges who help immigrants evade arrest in jurisdictions with sanctuary policies may themselves wind up behind bars.