Aug. 14 (UPI) -- A federal judge in a bench trial over the federal government's use of the California National Guard in Los Angeles in response to protests against President Donald Trump's immigration policies asked federal attorneys pointed questions about the legality of using the troops.

The case is being heard in San Francisco by U.S. District Judge Charles Breyer, who asked the questions about what limits there are against using federal law enforcement to protect federal buildings, which the U.S. Department of Justice claims is the reason for the almost 300 Guard troops still deployed in the state.

Trump deployed 4,000 guard troops and 700 Marines to the city in June. He said they were needed to protect federal property and law enforcement agents during the protests. Gov. Gavin Newsom rejected the use of his state's Guard and sued the federal government asking for an injunction that would limit the role of the federal government in the city.

The judge's comments came on the third and final day of the trial.

"Once you have a force in place, and maybe legitimately do so, and the threat that gave rise to the force in that place subsides, or is no longer of serious concern, what then?" Breyer asked a Justice Department attorney Wednesday. "How does one look at this national police force, which goes out of where the threat was and starts executing other laws?"