BOSTON (AP/WHDH) — A judge on Thursday blocked federal immigration authorities from arresting certain people suspected of living in the country illegally at Massachusetts courthouses while a lawsuit challenging the practice plays out.

U.S. District Judge Indira Talwani’s decision bars U.S. Immigration and Customs Enforcement from arresting people for civil immigration violations as they are arriving at, leaving or inside a courthouse.

The ruling came in a case brought by public defenders and prosecutors, who say such arrests are disrupting the criminal justice system because defendants, witnesses, and others are too afraid to come to court.

“This is a really significant victory,” said Oren Nimini of Lawyers for Civil Rights, one of the attorneys who filed the lawsuit. “It’s good protection for immigrant communities in Massachusetts, but also a good message to immigration authorities who have been running rampant over people’s civil rights over the last two years,” he said.

John Mohan, an ICE spokesman, said in an email that the agency is reviewing the court’s decision and has no further comment.

Courthouse arrests have angered lawyers, immigration advocates and even some judges, who want ICE to make courthouses “sensitive locations” generally free from immigration enforcement. While such arrests happened under President Barack Obama, lawyers say they’ve seen an uptick under President Donald Trump.

Talwani granted a preliminary injunction that will not only protect immigrants inside courts but those who are in courthouse parking lots or steps, while the lawsuit goes forward, Nimini said. It’s the first judicial ruling in the country to halt such immigration arrests across a state, he said.

New York state courts officials have also barred immigration agents from making arrests inside courthouses without judicial warrants or orders.

Under Talwani’s ruling, immigration authorities can still arrest people on civil immigration violations if the person is already in state or federal custody, like when a defendant is brought from a jail to a court hearing. It also doesn’t prevent ICE from making criminal arrests.

Trump has slammed the two prosecutors who brought the case, calling Suffolk County District Attorney Rachael Rollins and Middlesex County District Attorney Marian Ryan “people that probably don’t mind crime.”

“They are protecting people that in many cases, and certainly not in all cases, but in many cases are very dangerous people and you say why? What are they doing this for? What’s the game?” Trump said in May.

Rollins, who became the top prosecutor for Boston and surrounding communities in January, has said some cases against people accused of “heinous crimes” have grind to a halt because of civil immigration arrests.

She said in an emailed statement Thursday that she is “thrilled” with the ruling.

The Trump administration has said courthouses are some of the safest places for agents to make arrests because people typically need to go through metal detectors.

ICE says it’s focused on convicted criminals, gang members, and public safety threats as well as immigrants who have been previously deported or ordered to leave. The agency says family, friends, and witnesses in court won’t be arrested unless there are “special circumstances,” like when they pose a threat to public safety.

The lawsuit was filed days after federal prosecutors in Massachusetts charged a state court judge with helping a man who was living in the U.S. illegally to sneak out the back door of the courthouse to evade awaiting immigration agent. The judge’s attorney has called her prosecution political and says she’s innocent.

(Copyright (c) 2024 Sunbeam Television. The Associated Press contributed to this report. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox