BOSTON (AP) — 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 prosecutors in two of Massachusetts' largest counties and public defenders, 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 Nimni 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, Nimni 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.

Story continues

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.

Rollins said in an emailed statement Thursday that she is "thrilled" with the ruling. Ryan called the decision a "critical step in the right direction" for Massachusetts and said it should be a model for the rest of the country.

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 a waiting immigration agent. The judge's attorney has called her prosecution political and says she's innocent.

____

This story has been corrected to reflect that the attorney's name is Oren Nimni, not Nimini.

____

Follow Alanna Durkin Richer at http://www.twitter.com/aedurkinricher