A federal judge ruled the Trump administration cannot deploy National Guard troops or other military forces in California for law enforcement tasks, citing violations of the Posse Comitatus Act. U.S. District Judge Charles Breyer in San Francisco stated the administration “willfully” broke the law by using military personnel to handle protests against immigration policies.

California filed a lawsuit after the Trump administration sent National Guard troops and Marines to manage demonstrations. The court order, effective in 10 days, applies only to California. Breyer’s injunction stays until Sept. 12 to allow the administration time to appeal. While the ruling prohibits specific actions like arrests and crowd control, it does not require withdrawing 300 National Guard troops stationed in Los Angeles or using forces for guarding federal buildings.

The decision comes as Trump considered deploying National Guard units to cities like Oakland and San Francisco to address crime. In mid-August, he placed Washington, D.C.’s police under federal control and sent troops there to tackle what he called a “rampant crime problem.” Trump later cited 54 shootings in Chicago over the weekend, vowing to “solve the crime problem fast” as he planned National Guard deployments.

White House spokeswoman Anna Kelly criticized the ruling, calling it an overreach by a “rogue judge” attempting to undermine the president’s authority. Breyer’s order highlighted the administration’s use of troops for prohibited functions, including setting up barriers and demonstrating military presence in Los Angeles. He barred forces from making arrests, conducting searches, acting as informants, or collecting evidence.