Federal officers in the Minneapolis area participating in what officials described as the city’s largest recent U.S. immigration enforcement operation cannot detain or use tear gas against peaceful protesters who are not obstructing authorities, a Minnesota judge ruled Friday.

The ruling by U.S. District Judge Kate Menendez addressed a case filed in December on behalf of six Minnesota activists. The activists, who were among the thousands observing Immigration and Customs Enforcement and Border Patrol officers enforcing the Trump administration’s immigration crackdown in the Minneapolis-St. Paul area since the previous month, said government officers were violating constitutional rights of Twin Cities residents.

The enforcement operation has been marked by repeated clashes between federal agents and demonstrators since the crackdown began. The AP reported that confrontations escalated after an immigration agent fatally shot Renee Good in the head on Jan. 7 as she drove away from a scene in Minneapolis, an incident captured on video from several angles. The report also said agents have arrested or briefly detained many people in the Twin Cities.

In a statement after Menendez’s decision, U.S. Department of Homeland Security Assistant Secretary Tricia McLaughlin said the agency was taking “appropriate and constitutional measures to uphold the rule of law and protect our officers and the public from dangerous rioters.” She added that rioting is dangerous, saying obstructing law enforcement is a federal crime and assaulting law enforcement is a felony.

Menendez’s order limits officers’ ability to stop and detain people based on proximity to the enforcement activity. It prohibits officers from detaining drivers and passengers in vehicles when there is no reasonable suspicion they are obstructing or interfering with the officers. The ruling said safely following agents “at an appropriate distance does not, by itself, create reasonable suspicion to justify a vehicle stop.”

The judge also said the agents would not be allowed to arrest people without probable cause or reasonable suspicion that the person committed a crime or was obstructing or interfering with the activities of officers.

Menendez is separately presiding over another lawsuit, filed Monday by the state of Minnesota and the cities of Minneapolis and St. Paul, seeking to suspend the enforcement crackdown. At a hearing Wednesday, Menendez declined to grant the state’s request for an immediate temporary restraining order, the AP reported.

Brian Carter, an assistant attorney general for Minnesota, told Menendez that what the state needs most of all right now is a pause. He said, “The temperature needs to be lowered,” according to the AP. Menendez said the issues raised by the state and cities in that case are “enormously important,” but she ordered both sides to file more briefs next week after concluding the case raises high-level constitutional and other legal issues with few on-point precedents.