Sept. 2 (UPI) -- A federal judge in California ruled that the President Donald Trump administration's use of the California National Guard to control protests in Los Angeles was not legal.

U.S. District Judge Charles Breyer said Tuesday that the use of thousands of federalized Guard members and U.S. Marines to protect federal agents during an immigration crackdown in the city violated the Posse Comitatus Act. The 19th Century law bans the use of troops for domestic law enforcement.

A total of 4,000 National Guard troops and 700 Marines were deployed to the city in June, as Trump said they were needed to protect federal property and law enforcement agents amid the protests, prompting Gov. Gavin Newsom to call for an injunction to limit the federal government's role in the city.

Breyer held a multi-day bench trial in August to determine the legality of using the Guard as law enforcement.

Related