CHICAGO (AP) — A federal judge said Thursday she will order federal agents in Chicago to restrict using force against peaceful protesters and news media outlets, stating that current practices violate their constitutional rights.

The preliminary injunction is a result of a lawsuit claiming federal agents have employed excessive force during immigration enforcement actions in the area.

U.S. District Judge Sara Ellis emphasized the need for agents to give advance warnings prior to deploying riot control measures and that the use of force must be necessary to prevent immediate threats. She described incidents where agents used tear gas and pepper balls against demonstrators as unacceptable.

During the trial, witnesses detailed emotional experiences of being targeted during protests, raising awareness about the climate of fear impacting civic engagement. Judge Ellis’ ruling aims to enhance accountability and protect the rights of protesters and journalists.