BOSTON — A Massachusetts judge has been indicted on obstruction of justice charges for allegedly helping a man in the country illegally to evade immigration officials.

Massachusetts U.S. Attorney Andrew Lelling announced the charges against Newton District Court Judge Shelley M. Richmond Joseph on Thursday. Former court Officer Wesley MacGregor was also charged.

Joseph came under federal investigation after authorities said she and her staff helped a defendant leave the courthouse last year after a hearing on charges, including drug possession.

Prosecutors say an immigration agent was in the courthouse to detain the suspect following the hearing, but Joseph and the court officer schemed to help him leave out a back door.

It was not immediately clear if Joseph and MacGregor have lawyers.