Marines and National Guard troops communicate as they deal with protesters on the front steps of the Edward Roybal Federal Building in Los Angeles, Calif., June 14, 2025.

A federal judge has blocked President Donald Trump’s deployment of the National Guard in California based on "an ongoing risk" that the president will act unlawfully.

U.S. District Judge Charles Breyer in San Francisco wrote Sept. 2 that Congress was clear in the 1878 Posse Comitatus Act that lawmakers prohibited using the U.S. military for domestic law enforcement.

But he ruled there was no rebellion when Trump deployed the National Guard and Marines to Los Angeles in June, ostensibly to quell a rebellion and ensure that immigration law was enforced. Breyer cited plans by Trump and Defense Secretary Pete Hegseth to expand the guard deployment to Oakland and San Francisco, and in other states across the country.

"Yet there was no rebellion, nor was civilian law enforcement unable to respond to the protests and enforce the law," Breyer wrote. "The evidence at trial established that Defendants systematically used armed soldiers (whose identity was often obscured by protective armor) and military vehicles to set up protective perimeters and traffic blockades, engage in crowd control, and otherwise demonstrate a military presence in and around Los Angeles. In short, Defendants violated the Posse Comitatus Act."

A federal appeals court had decided in June that Trump could keep control of the National Guard after an earlier ruling from Breyer that Trump had deployed the National Guard unlawfully.

A three-judge panel of the 9th U.S. Circuit Court of Appeals found that Trump could retain control over California's National Guard while Democratic Gov. Gavin Newsom pursued his lawsuit against the deployment.

The case is being closely watched because Trump separately mobilized the National Guard in Washington, DC, and threatened to bring troops to Chicago and other cities. Trump's authority to use the guard in Washington is unique because it is the seat of the federal government, but Chicago Mayor Brandon Johnson called the threatened move in his city "tyranny."

Trump deployed the National Guard to Los Angeles in June during a period of sometimes violent protests against federal immigration enforcement agents. Newsom and Mayor Karen Bass said there was no emergency justifying the military.

Breyer ordered that the 300 National Guard troops who remain active in Los Angeles not engage "in arrests, apprehensions, searches, seizures, security patrols, traffic control, crowd control, riot control, evidence collection, interrogation, or acting as informants."

"The ruling is clear: Trump is breaking the law by trying to create a national police force with himself as its chief," Newsom said in a social media post.

Bass issued a statement that "the White House tried to invade the second-largest city in the country."

"That was illegal," Bass said. "Los Angeles will not buckle and we will not break."

But Trump told reporters in the Oval Office that the decision came from "a radical left judge" who left the troops in place.

"The judge said, 'But you can leave the 300 people that you already have in place,'" Trump said. "That's all we need."

Acting U.S. Attorney Bill Essayli in Los Angeles called the judge’s order misleading because the troops will remain.

"This is a false narrative and a misleading injunction," Essayli said on social media. "The military has never engaged in direct law enforcement operations here in LA."

Breyer’s three-day trial, which ended Aug. 13, focused on what the military did in assisting Immigration and Customs Enforcement authorities and other law enforcement.

Lawyers for the state attorney general’s office argued that troops had performed police functions by setting up security perimeters and detaining at least two people. If Trump’s action was left unchallenged, the lawyers argued, it would "usher in a vast and unprecedented shift in the role of the military in our society."

But Trump administration lawyers argued that the troops protected federal agents and stayed within their legal limits.

The administration's lawyers tried to show that the troops acted only to protect federal agents from perceived threats and had stayed within their legal limits. At the time of the trial, troops were providing security during raids on marijuana farms outside Los Angeles.

This story has been updated to add new information.

This article originally appeared on USA TODAY: Judge blocks Trump deployment of National Guard in California

Reporting by Bart Jansen, USA TODAY / USA TODAY

USA TODAY Network via Reuters Connect