(CNN) Massachusetts district attorneys and public defenders are filing a lawsuit Monday to stop Immigration and Customs Enforcement from patrolling state courthouses.

The lawsuit alleges that criminal defendants, witnesses and civil litigants have all been affected by the agency's policy, thereby impeding court business.

"Entire communities now view the Massachusetts courts as places where they cannot go, for any reason, greatly impeding access to justice and undermining the administration of justice in these communities," the complaint reads.

The lawsuit describes how ICE's policy is allegedly undermining the work of prosecutors and defense attorneys who depend on witnesses "to carry out investigations, prosecutions, and criminal defense." The case, according to the lawsuit, is the first time that district attorneys and public defenders have joined as plaintiffs to challenge what they say is a threat to the state's justice system.

ICE's increasing presence at courthouses under the Trump administration has drawn the ire of advocates and lawyers who have warned that it has a chilling effect within communities.

Read More