BOSTON (WHDH) - Federal officials have indicted a Massachusetts trial court judge and a trial court officer with obstructing justice and perjury after they allegedly conspired together to prevent an ICE agent from taking a twice-deported drug suspect into custody last year.

U.S. Attorney Andrew E. Lelling announced charges Thursday against Newton District Court Judge Shelley M. Richmond Joseph, 51, of Natick, and Court Officer Wesley MacGregor, 56, of Watertown, who are both accused of preventing an ICE agent from detaining a drug suspect in April 2018.

Joseph and MacGregor both entered not guilty pleas during their arraignments in Boston federal court.

The suspect, who had been arrested by Newton police for narcotics possession and being a fugitive from justice, had been deported from the United States in 2003 and 2007 and had been barred from returning until 2027, according to the indictment.

In the indictment, prosecutors say Joseph discussed the ICE agent with the suspect’s defense attorney in a sidebar recorded by the courtroom’s court recorder.

“…ICE is going to pick him up if he walks out the front door. But I think the best thing for us to do is clear the fugitive issue, release him on a personal, and hope that he can avoid ICE … That’s the best I can do,” the attorney allegedly said.

Joseph allegedly responded, “ICE is gonna get him? What if we detain him?” before having the courtroom recorder turned off for a little less than a minute.

When it was turned back on, Joseph was allegedly recorded saying the suspect had some property downstairs that he would have to retrieve.

That’s when prosecutors say MacGregor escorted him to lockup and then used his security access card to open the rear sally-port exit, where the defendant was able to avoid being taken into custody by the ICE agent.

RELATED: Healey slams indictment of Mass. judge as a ‘politically motivated attack on our state’

MacGregor is also accused of falsely testifying before a Grand Jury that he was unaware that an ICE agent was in the building.

Joseph and MacGregor are both facing charges of conspiracy to obstruct justice, obstruction of justice; aiding and abetting, obstruction of a federal proceeding; aiding and abetting, and one count of perjury.

In a statement Friday afternoon, the Supreme Judicial Court announced that Joseph has been suspended without pay.

In a statement, Lelling said, “This case is about the rule of law. 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. We cannot pick and choose the federal laws we follow, or use our personal views to justify violating the law. Everyone in the justice system — not just judges, but law enforcement officers, prosecutors, and defense counsel — should be held to a higher standard. The people of Massachusetts expect that, just like they expect judges to be fair, impartial, and to follow the law themselves.”

Gov. Charlie Baker called the allegations “serious” and called the indictment a “big statement.”

“I was glad to see the courts here in the Commonwealth suspend the judge without pay during the proceedings,” he told 7News. “The issues that were raised by this particular circumstance were disturbing.”

Attorney General Maura Healey slammed the judge’s indictment, calling it a “politically motivated attack on our state and the independence of our courts.”

“Today’s indictment is a radical and politically-motivated attack on our state and the independence of our courts. It is a bedrock principle of our constitutional system that federal prosecutors should not recklessly interfere with the operation of state courts and their administration of justice,” the statement read. “This matter could have been appropriately handled by the Commission on Judicial Conduct and the Trial Court. I am deeply disappointed by U.S. Attorney Andrew Lelling’s misuse of prosecutorial resources and the chilling effect his actions will have.”

Joseph and MacGregor are due back in front of a judge at a later date.

(Copyright (c) 2020 Sunbeam Television. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)