A Massachusetts federal judge appointed by former President Barack Obama ruled that Immigration and Customs Enforcement (ICE) agents cannot make arrests at courthouses in the state, dealing a major blow to the agency.

Judge Indira Talwani of the U.S. District Court for the District of Massachusetts ruled Thursday that ICE agents are barred from “civilly arresting parties, witnesses and others attending Massachusetts courthouses on official business while they are going to, attending or leaving the courthouse,” per Talwani’s Memorandum and Order.

ICE agents are not only prohibited from apprehending illegal aliens inside courthouses, but they also cannot make arrests on courthouse steps and parking lots. The ruling is the first in the country to prohibit these type of immigration arrests across a whole state, according to the Associated Press.

Talwani was nominated to serve on the court by then-President Barack Obama in 2013, and she began serving the following year.

The preliminary injunction came in a case filed by a coalition of prosecutors, public defenders and other immigration activists in April. The plaintiffs argue that ICE arrests in courthouses make illegal immigrants fearful to step into a courtroom at all, making it harder to bring forward crime witnesses and victims who may be living in the U.S. illegally.

“Prosecutors are forced to abandon cases because many victims and witnesses are deterred from appearing in court. The policy also makes it more difficult to obtain defendants’ appearance[s] in court,” Middlesex County District Attorney Marian Ryan and Suffolk County District Attorney Rachael Rollins, both of whom are Democrats, wrote in a joint-statement in April.

Federal immigration authorities, on the other hand, argue that courtroom arrests are safer for both agents and the community because visitors typically have to pass through a metal detector, eliminating the possibility that a suspected illegal immigrant is carrying a weapon.

Former ICE Acting Director Thomas Homan penned an op-ed lambasting sanctuary policies that protect illegal aliens, and he singled out why courthouses should never be off-limits. (RELATED: Former Acting ICE Director Tom Homan Rejoining The Trump Administration As Border Czar)

“First of all, this doesn’t make sense. ICE is not interested in identifying any victim or witnesses to crime. A sanctuary policy prevents ICE from accessing jails, and it prevents ICE from being notified when an illegal alien is released from a jail,” Homan wrote Monday. “If victims and witnesses are afraid to report a crime, it is because of the false stories pushed out to the public by pro-immigrant groups, NGOs and politicians who want to vilify and mischaracterize ICE.”

The ruling is the latest spat between federal immigration authorities and local, liberal-leaning officials in Massachusetts.

Judge Shelley Richmond Joseph and court officer Wesley MacGregor were indicted by a federal grand jury in April for allegedly helping an illegal alien, wanted for drunk driving, escape through a back door in 2018 and evade an ICE agent who was waiting nearby to apprehend him.

ICE did not immediately respond to a request for comment the Daily Caller News Foundation.

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@dailycallernewsfoundation.org.