Prosecutors, public defenders, and community groups in Massachusetts announced a federal lawsuit against U.S. Immigration and Customs Enforcement over its policy of arresting people at courthouses on civil immigration matters.

Middlesex District Attorney Marian Ryan and Suffolk District Attorney Rachael Rollins were among those who announced the complaint at a news conference Monday.

"These actions do nothing to further public safety or the rule of law," Rollins said of ICE agents at courthouses. "In fact, as we've laid out in the suit filed today, ICE's directives violate multiple well established legal principals."

The lawsuit states ICE's presence at courthouses intervene with the justice system since it intimidates undocumented witnesses and defendants from appearing.

"ICE's using state courthouses as a forum to conduct their enforcement work has struck fear in many of our most vulnerable, keeping them from accessing our courts," said Ryan. "That is not justice. It does not make our communities safer."

Monday's announcement comes days after federal prosecutors charged a judge and former court officer with obstruction of justice for allegedly helping a man wanted by federal immigration authorities escape a courthouse.

Newton District Court Judge Shelley M. Richmond Joseph and former Trial Court Officer Wesley MacGregor were indicted on an obstruction of justice charge on Thursday. The two allegedly helped a man living in the U.S. illegally evade a waiting immigration enforcement officer by leaving through a back door.

The suspects pleaded not guilty during their appearance in Boston federal court.

The charges came from a March 30, 2018 case when Jose Medina Perez was charged with drug possession and being a fugitive from justice from Pennsylvania. He evaded an ICE agent during his April 2 arraignment, but was caught about a month later. He is now in immigration proceedings.

This is what leadership looks like "an unprecedented move" in the midst of unprecedented times." Thank you @DARollins @DAMarianRyan for taking on this rogue agency. https://t.co/XvOVd3UbEy — Ayanna Pressley (@AyannaPressley) April 29, 2019

Ryan added that in order to make "meaningful and positive change" everyone needs to work together.

"This lawsuit represents the first time that prosecutors, public defenders and advocates have filed a lawsuit with the goal of formally ending this practice," she said. "As our country wrestles with the complex problem of the state of the American immigration system, we cannot permit access to the courts of this Commonwealth by all of its residents to be detrimentally affected."

Massachusetts Attorney General Maura Healey called last week's action a political move.

"I think it's a political move, I think it's a radical move and it will have a chilling effect," said Healey. "This is the only U.S. Attorney in the entire country who has taken such action. I find it really troubling."

Those behind the federal lawsuit say this has been in the works for a year and goes far beyond one case.

"We are not challenging ICE's ability to enforce immigration laws, we are challenging where they do this enforcement," said Wendy Wayne of Public Counsel Services.

Democratic Massachusetts Congresswoman Ayanna Pressley praised the move on Twitter Monday.

"This is what leadership looks like 'an unprecedented move' in the midst of 'unprecedented times.' Thank you @DARollins @DAMarianRyan for taking on this rogue agency."

Bristol County Sheriff Thomas Hodgson also weighed in condemning the lawsuit.

"Shame on the elected officials and pro-illegal advocates for filing this frivolous lawsuit, which seeks to make it more difficult for federal law enforcement officers to apprehend criminal illegal aliens," Hodgson said in a statement. "As elected officials swore to protect the people who put them in office, or as U.S. citizens who want their neighborhoods and families to be more safe, these district attorneys and advocates should be working with law enforcement instead of partnering with criminal illegal immigrants."

An email and a voicemail were left with ICE for comment.