A federal judge on Tuesday blocked the Trump administration from deploying the National Guard in California to fight crime.
San Francisco-based US District Judge Charles Breyer issued the order for the US District Court, Northern District of California, according to a court filing.
He put the ruling on hold until September 12. The Trump administration is likely to appeal. Trump ordered 4,000 National Guard and 700 active duty US Marines to Los Angeles in June in response to protests against large-scale immigration raids in the second largest US city.
The deployment inflamed tensions in the city and drew condemnation from Democrats, who said Trump was using the military to stifle opposition to his hardline immigration policies.
The case raised novel legal questions about presidential authority.
The lawsuit by California Governor Gavin Newsom, a prominent Democrat, alleged the troops violated long-standing US norms and a law known as the Posse Comitatus Act, which sharply limits the use of federal troops for domestic enforcement.