Kevin Johnson and Joey Garrison | USA TODAY

BOSTON – Federal prosecutors charged a Massachusetts judge with obstruction of justice Thursday, saying she prevented immigration agents from arresting an undocumented immigrant after a state court hearing by allowing him to leave the courthouse through a back door.

The indictment marked an unusual escalation in the federal government's strict immigration enforcement policy, and its battles with states and local governments that shelter migrants. The indictment accuses District Judge Shelley Richmond Joseph and a court officer, Wesley MacGregor, of allowing the immigrant to leave the courthouse, out of a federal agent's sight, and lying about it later.

The charges come in the midst of a standoff between the Trump administration and dozens of U.S. communities that have objected to providing the federal government information on residents' immigration status.

Want news from USA TODAY on WhatsApp? Click this link on your mobile device to get started

The U.S. Attorney in Boston, Andrew Lelling, said the case is "about the rule of law," not immigration. "We do not view this case in response to the public debate over immigration enforcement. There are reasonable arguments on both sides of that debate, but this isn’t a policy seminar," said Lelling, who was appointed by President Donald Trump in 2017.

Joseph, a judge in Newton near Boston, is charged with one count of obstruction of justice and two counts of aiding and abetting to obstruct justice. MacGregor, who retired last month from his court duties, faces the same charges, plus a perjury count. Both pleaded not guilty to all charges in Boston federal court late Thursday afternoon before a federal magistrate.

The obstruction charges carry a maximum penalty of 20 years in federal prison. They were released without having to post bond. Both have to surrender their passports and are restricted from traveling outside the U.S. MacGregor, who is licensed to carry, must surrender his firearm.

"This prosecution is absolutely political," said Thomas Hoopes, an attorney representing Joseph as he escorted the judge away from the courthouse. "Shelley Joseph is absolutely innocent.”

He declined to discuss the case further.

“This prosecution is absolutely political. Shelley Joseph is absolutely innocent,” an attorney for the Massachusetts judge said just now after she pleaded not guilty to obstruction charges for allegedly helping an undocumented immigrant escape ICE. pic.twitter.com/4eYkmab5Vs — Joey Garrison (@joeygarrison) April 25, 2019

The charges drew swift criticism, particularly from the left. Matthew Segal, the legal director for the American Civil Liberties Union of Massachusetts, called the indictment "very aggressive" and "completely outrageous."

Massachusetts Attorney General Maura Healey, a Democrat, also slammed the indictment as a “radical and politically-motivated attack on our state and the independence of our courts.”

Prosecutors alleged that during an April 2018 court hearing in Newtown, Mass., Joseph and MacGregor allowed the Dominican national, detained on drug and outstanding warrant charges, to leave the courthouse from a downstairs back door after the judge instructed an immigration agent to wait in the hallway outside her courtroom.

Steven Senne, AP

The migrant, later identified as Jose Medina-Perez, had previously been deported from the United States twice before – in 2003 and in 2007 – and had been barred from re-entering the country until 2027.

Immigration and Customs Enforcement (ICE) officials learned of Medina-Perez's detention following his March 30, 2018, arrest when local police submitted his fingerprints to the national law enforcement database. The fingerprint notification prompted ICE officials to issue a detainer, requesting local police to alert them within 48 hours of any planned release.

View | 20 Photos

President Donald Trump threatens to shut down the U.S.-Mexico border

In court documents, federal prosecutors offered up a partial transcript of the court proceeding in which the judge, defense attorney and court clerk refer to the migrant's status and the risk that he would be detained by immigration officials following the hearing.

"ICE is gonna get him?" Joseph asks the migrant's defense attorney.

"Yeah," the attorney responds.

Soon after the exchange, prosecutors allege, Joseph directed the courtroom recorder to be "turned off" for 52 seconds while the discussion continued.

The defense attorney later asked that Medina-Perez be allowed to retrieve his property from a downstairs lockup.

Reminded that the ICE agent was waiting outside the courtroom, the judge allegedly said: "That's fine. I'm not gonna allow them to come in here. But (the migrant) has been released on this."

When he was escorted downstairs, prosecutors asserted that MacGregor used his security access card to release Medina-Perez "out the back door."

Prosecutors also charged that MacGregor lied to a grand jury about what happened.

Joseph, who is prohibited from commenting as part of the Massachusetts Code of Judicial Conduct, was suspended without pay Thursday by the state's Supreme Judicial Court.

Francis Kenneally, clerk of the state courts, said that the suspension is based only on the indictment for alleged misconduct.

"It in no way reflects any opinion on the merits of the pending criminal case," Kenneally said.

Prosecutors had said they were allowing Joseph and MacGregor to self-surrender. That happened with Joseph but not with MacGregor, who was arrested at his home. He appeared in court wearing baggy shorts and a black Boston Celtics t-shirt.

Joey Garrison

In court, Christine Wichers, an assistant U.S. attorney, explained the mix-up by saying prosecutors were unable to reach MacGregor before officers showed up to arrest him.

Massachusetts Gov. Charlie Baker, a moderate Republican, had called for the removal of Joseph from the bench last year after details about the alleged courtroom incident were first reported by the Boston Globe.

Joseph, 51, was appointed to the judgeship in 2017 by Baker after 25 years in both the public and private sectors. She had most recently practiced law at a firm she founded in 2003 with her husband that specialized in criminal defense.

Federal authorities launched the grand jury investigation within weeks after the 2018 hearing, and it continued through this month, according to court documents.

In addition to the judge's alleged actions at the hearing, prosecutors contend that Joseph made "false statements" about the matter to other state judges who inquired about the case, including a senior district judge who asked why the courtroom recording device had been disabled.

Joseph allegedly attributed it to "unfamiliarity" with the equipment.

All of that, prosecutors said, amounted to a violation of obstruction laws. “We cannot pick and choose the federal laws we follow, or use our personal views to justify violating the law," Lelling said.

“The actions of the judge in this incident are a detriment to the rule of law and highly offensive to the law enforcement officers of ICE who swear an oath to uphold our nation’s immigration laws,” said Todd M. Lyons, the acting ICE chief in Boston.

Lelling said Medina-Perez was caught about a month after leaving the Newton courthouse and is being processed for deportation.

Lelling, who is leading the Justice Department’s far-flung investigation into a college admissions scandal in which 33 affluent parents are accused of paying bribes to get their children into college, indirectly referenced that case in his Thursday announcement.

“More recently, I’ve had occasion to point out that the law must apply to all of us – even the rich and famous," he said. "Today I would add that it must apply to the privileged and the powerful.”

He said that in “certain quarters I’ve heard the occasional gasp of dismay or outrage” about charging a judge. “But if the law is not applied equally, it cannot credibly be applied to anyone.”

Johnson reported from Washington.

View | 18 Photos

Border Patrol detains immigrant families crossing US-Mexico border