A federal judge in California has ruled that the way President Donald Trump deployed the National Guard to Los Angeles this summer was illegal,
BBC reports.
The ruling comes as Trump seeks to use National Guard troops in order to crack down on crime in other US cities and support immigration enforcement.
US District Judge Charles Breyer said Trump violated the Posse Comitatus Act, which limits the power of the federal government to use military force for domestic matters.
White House spokeswoman Anna Kelly said that "a rogue judge is trying to usurp the authority of the Commander-in-Chief to protect American cities from violence and destruction".
The ruling is on hold until 12 September.
The Trump administration will likely appeal against the ruling.
"The President is committed to protecting law-abiding citizens, and this will not be the final say on the issue," Ms Kelly said.
California Governor Gavin Newsom said in a statement that "the court sided with democracy and the Constitution".
In response, Trump said that he may send the troops back into the city, arguing that the governor there is "very weak", and needs his help.
"He's going to need us again, because it's starting to form again. I see it," Trump said in an event at the White House. He also argued that the 2028 Olympic Games in LA would have been cancelled if not for his military deployment.
Trump deployed National Guard troops to Los Angeles in June in response to protests against immigration raids.
The White House argued it was necessary to quell violence, but California officials argued that their law enforcement could handle the situation without military intervention.
The president has also deployed hundreds of National Guard troops in Washington DC and has weighed dispatching troops to Chicago as soon as this week.
"We're going in," Trump told reporters when asked about Chicago after the judge's LA ruling was announced. "I didn't say when, but we're going in."
Judge Breyer's order only applies in California, but could signal legal challenges ahead for Trump's plans to use the Guard to enforce his policies.
After Trump deployed troops to Los Angeles, Governor Newsom sued the administration for alleged violations of the Posse Comitatus Act.