Andrew Lelling, U.S. attorney for the District of Massachusetts, announced charges Thursday against a judge and a former court officer accused of helping an undocumented migrant avoid immigration officials in Newton, Mass. (Steven Senne/AP)

A Massachusetts state court judge and a former court officer were charged by federal prosecutors Thursday with obstructing justice for allegedly preventing an immigration and customs officer from arresting an undocumented immigrant at a courthouse west of Boston last year.

Judge Shelley M. Richmond Joseph, 51, and Wesley MacGregor, 56, a former trial court officer at the Newton, Mass., court where the judge sits, helped the man — wanted on fugitive charges in Pennsylvania and for narcotics possession — avoid being picked up by an officer of Immigration and Customs Enforcement, according to an indictment filed by the U.S. attorney for Massachusetts.

“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,” said Andrew Lelling, the U.S. attorney.

The ICE officer was in the courthouse on April 2, 2018, when the detainee was being arraigned on criminal charges. However, the officer was kept out of the courtroom by the judge, according to evidence included in the indictment.

After a courtroom sidebar conference, during which the courtroom recorder was turned off for less than a minute, MacGregor, acting as bailiff, escorted the detainee to a downstairs lockup.

From there, MacGregor allegedly used his security access card to open a rear exit from the courthouse and release the man, identified in the indictment only as “the alien subject.”

At one point during the on-the-record court proceedings more than a year ago, a court clerk said that a representative of ICE was “here in the court . . . [unintelligible] to, to visit the lockup,” according to a transcript included in the indictment.

“That’s fine,” Joseph responded, according to the transcript. “I’m not gonna allow them to come in here.” She added, “But he’s been released on this,” in apparent reference to an assistant district attorney dismissing the fugitive charge against the man moments earlier.

The excerpts of the court transcript in the indictment suggest that the drug charges would be the subject of a later pretrial conference. The judge approved that course of action.

At another point in the April 2018 proceedings, the suspect’s attorney said his client was not the person ICE was seeking. “ICE is going to pick him up if he walks out the front door,” the defense attorney said.

Joseph and MacGregor were scheduled to be arraigned in federal court Thursday. Joseph was suspended from her judgeship without pay on Thursday.

The office of Massachusetts Gov. Charlie Baker (R) expressed support for Joseph’s suspension. “Governor Baker believes no one should obstruct federal law enforcement officials trying to do their jobs and supports the Supreme Judicial Court’s decision to suspend Judge Joseph without pay,” according to a prepared statement from Lizzy Guyton, Baker’s spokeswoman. “The Baker-Polito Administration has filed legislation to allow court officials as well as law-enforcement to work with federal immigration officials to detain dangerous individuals.”

Joseph, MacGregor and their attorneys could not be reached for comment Thursday by The Washington Post.

Joseph and MacGregor are both charged with conspiracy to obstruct justice; obstruction of justice, aiding and abetting; and obstruction of a federal proceeding, aiding and abetting. In addition, MacGregor is charged with perjury for allegedly making false statements to a grand jury.