A federal judge in Oregon restricted federal officers’ use of tear gas and other chemical or projectile munitions during protests at the U.S. Immigration and Customs Enforcement building in Portland, limiting when agents may deploy those crowd-control tools. The preliminary injunction from U.S. District Judge Michael Simon took effect Monday and will remain in place while the lawsuit proceeds.

The ruling followed a lawsuit filed by the ACLU of Oregon on behalf of protesters and freelance journalists, with plaintiffs describing chemical or projectile munitions being used against them during demonstrations at the ICE building. The judge issued the order after a three-day hearing in which plaintiffs testified, including a demonstrator known for wearing a chicken costume, a married couple in their 80s, and two freelance journalists.

In his Monday order, Simon cited evidence presented to the court and said plaintiffs provided videos that “unambiguously show DHS officers spraying OC Spray directly into the faces of peaceful and nonviolent protesters engaged in, at most, passive resistance and discharging tear gas and firing pepper-ball munitions into crowds of peaceful and nonviolent protestors.” He also wrote that the defendants’ conduct was “objectively chilling,” describing physically harming protesters and journalists without prior dispersal warnings.

Simon’s order also set specific conditions for when chemical or projectile munitions could be used. He limited federal agents from using chemical or projectile munitions such as pepper balls and tear gas unless someone posed an imminent threat of physical harm, and he directed that munitions could not be fired at the head, neck or torso “unless the officer is legally justified in using deadly force against that person.”

The judge further addressed how OC spray can be used. Simon ordered that officers cannot use pepper spray against a group in an indiscriminate way that would affect bystanders, and that targeting must be limited to people engaging in violent unlawful conduct or actively resisting arrest, or to situations where it is used “as reasonably necessary in a defensive capacity.” He specified that trespassing, refusing to move, and refusing to obey an order to disperse are acts of passive, not active, resistance.

Simon also granted provisional class certification, meaning the order covers a broader group of people who have peacefully protested or reported on demonstrations at the ICE building in recent months. The preliminary injunction mirrors a prior temporary restraining order from Simon that similarly limited federal agents from using chemical munitions at the ICE building, and it marked the second in recent days restricting tear gas use at the facility—after another judge’s order in a separate case involving residents of an adjacent affordable housing complex.

The federal Department of Homeland Security said it was “authorized to do what is appropriate and necessary in each situation to diffuse violence against our officers in the most appropriate manner possible,” according to an emailed statement shared by the agency.

The courtroom dispute unfolded amid protests in cities across the country tied to the immigration enforcement surge associated with President Donald Trump’s administration, and it adds to mounting concern about federal crowd-control tactics at demonstrations targeting immigration enforcement.