Middlesex County District Attorney Marian Ryan and Suffolk County District Attorney Rachael Rollins, along with public defenders and community groups, announced Monday they’ve filed a federal lawsuit against the U.S. Immigration and Customs Enforcement (ICE)’s policy of arresting civil immigrant violators at state courthouses.

Ryan said the lawsuit seeks an immediate injunction to stop ICE agents from making courthouse arrests — including courtrooms, hallways, clerk’s offices, parking lots and front steps — arguing that it’s a violation of the constitution and state rights.

“This lawsuit seeks a declaration from the court that the written ICE directive, which authorizes the arrest of people on civil charges, using the courts of the commonwealth, is unlawful,” Ryan said.

A spokesman for ICE declined to comment on the lawsuit, citing the ongoing litigation.

The two district attorneys are the lead prosecutors in two of the commonwealth’s biggest counties.

Rollins said the lawsuit marks a historic moment.

“I do not take this action lightly,” Rollins said, “but standing by silently as immigration officials, under the explicit direction of the president of the United States strips our justice system of its ability to function, simply is not an option.”

Rollins said that the justice system can only function when people feel safe coming to court.

“As prosecutors, we cannot fulfill our statutory obligation to victims of crimes when ICE unilaterally engages in civil arrest,” Rollins said.

“Federal ICE agents have been regularly stalking our state courthouses in communities throughout Massachusetts for the last two years," said Wendy Wayne of the Committee for Public Counsel Services, which represents immigrant clients and is a plaintiff in the lawsuit.

“Access to justice is denied by everyone when witnesses and victims are refusing to come to court for fear of being arrested by ICE agents," Wayne said.

Read more: Prosecutors Sue Feds To Stop Courthouse Immigration Arrests

Ryan said ICE activity at state courthouses has had a chilling effect.

“The result of this fear that keeps people from exercising their right to come to court is that victims suffer in silence and people continue to be abused in their homes,” Ryan said.

Gladys Vega, the executive director of the Chelsea Collaborative, said that “the real situation now is that people are afraid.” As a result of that fear, Vega said her organization is mediating three to five cases a week rather than going to court.

Ivan Espinoza-Madrigal, the executive director of the Lawyers’ Committee for Civil Rights and Economic Justice, which is supporting the lawsuit, accused ICE of acting unjustly.

“Immigrants are being hunted down and this is harmful to all of us,” said Espinoza-Madrigal, “and we are fighting back. This is our legal and moral responsibility.”

Ryan said the lawsuit is unrelated to last week's federal indictment of a state court judge for allegedly helping a suspect evade ICE.