Hours after California Gov. Gavin Newsom vowed to seek a court order to stop President Trump from deploying 300 of the state’s National Guard troops in Oregon, a federal judge issued a temporary restraining order on Sunday night.

Officials from California and Oregon sought the restraining order after the president sent California Guard troops to Oregon earlier on Sunday.

“The rule of law has prevailed — and California’s National Guard will be heading home,” Newsom said in a statement. “This ruling is more than a legal victory, it’s a victory for American democracy itself. Donald Trump tried to turn our soldiers into instruments of his political will, and while our fight continues, tonight the rule of law said, ‘Hell no.’”

The federal judge who issued the restraining order Sunday evening had, just a day before, temporarily blocked the Trump administration’s efforts to federalize Oregon’s National Guard.

“What was unlawful yesterday is unlawful today,” Oregon Atty. Gen. Dan Rayfield told the Associated Press. “The judge’s order was not some minor procedural point for the president to work around, like my 14-year-old does when he doesn’t like my answers.”

Originally, the two states only named the California National Guard when seeking the court order. They asked for the order to be expanded to any Guard troops, however, after a memo from Defense Secretary Pete Hegseth was submitted to the court saying up to 400 Texas National Guard personnel were being activated for deployment to Oregon, Illinois and possibly elsewhere.

Texas Gov. Greg Abbott said Sunday night in a post on X that he “fully authorized” the use of the Texas National Guard to “ensure safety for federal officials.” “You can either fully enforce protection for federal employees or get out of the way and let Texas Guard do it,” he wrote.

In the more sweeping order on Sunday evening, Judge Karin Immergut questioned the federal government’s attorney, asking how the decision to send troops from California and Texas to Oregon could not be seen as anything other than circumventing her order.

Constitutional law experts also called the move an obvious effort by the president to sidestep the judge’s ruling on Saturday.

“This is a blatant attempt to circumvent Judge Immergut’s order,” said Elizabeth Goitein, the senior director of the Brennan Center’s Liberty and National Security Program. “Her decision makes very clear that there is no lawful basis for deploying federalized National Guard troops in Oregon.”

Such an action is without precedent, said Jessica Levinson, a law professor at Loyola Law School.

“I cannot think of a historic analog where we have the president — against the will of local elected officials — sending the federalized National Guard from state A to state B,” she said.

Trump, who mobilized the California National Guard amid immigration protests in Los Angeles in June, has pursued the use of the military in cities including Chicago and Washington, sparking outrage among Democratic officials in those jurisdictions.

He says the interventions are needed to fight crime. Local leaders, including those in Portland, have said the actions are unnecessary and without legal justification.

“The Trump Administration is unapologetically attacking the rule of law itself and putting into action their dangerous words — ignoring court orders and treating judges, even those appointed by the President himself, as political opponents,” Newsom said.

The federal jurist who issued the ruling in Oregon, Judge Immergut, was appointed by Trump during his first term.

In June, Newsom and California Atty. Gen. Rob Bonta filed a federal lawsuit over Trump’s mobilization of the state’s National Guard during immigration protests in Los Angeles.

In a statement before Judge Immergut’s ruling Sunday evening, White House spokesperson Abigail Jackson said that Trump “exercised his lawful authority to protect federal assets and personnel in Portland following violent riots and attacks on law enforcement.”

Referring to Newsom by a crude nickname, she said that he “should stand on the side of law-abiding citizens instead of violent criminals destroying Portland and cities across the country.”

Jackson couldn’t be reached Sunday evening following the temporary restraining order.

Portland is a new focus

There have been regular protests in Portland outside a U.S. Immigration and Customs Enforcement building in recent weeks. But those demonstrations in a city of nearly 650,000 have been far smaller and less disruptive than, for example, the protests there during the summer of 2020.

Immergut noted in her ruling Saturday that the scale of recent demonstrations didn’t justify the use of federalized forces and that deploying them could hurt Oregon’s sovereignty.

Goitein said it was clear that the conditions detailed under that order had not been met by the Trump administration. “So what he’s doing is illegal, under her opinion,” Goitein said.

Trump appealed the judge’s ruling late Saturday.

Tension in California

As protesters filled L.A. streets in June to demonstrate over federal immigration enforcement raids, Trump deployed nearly 2,000 members of the National Guard to the city without the consent of the governor.

If not for the National Guard, Trump said, “Los Angeles would have been completely obliterated.”

But local and state leaders criticized the move as an unwarranted escalation. And The Times reported that many Guard personnel had little to do and seemed bored by the assignment.

Days after the Guard was deployed, Newsom and Bonta filed a lawsuit. Last month, a federal judge ruled that the president’s use of the National Guard soldiers and Marines in L.A. was illegal — but he allowed the 300 remaining here to stay as long as they did not enforce civilian laws. The Trump administration appealed the ruling.

Those same 300 troops were rerouted to Portland on Sunday, a spokesperson for the governor said.

“The Trump Administration’s flagrant disregard for the courts was on full display when it sought to circumvent Judge Immergut’s order blocking the federalization of the Oregon National Guard by redeploying troops from Los Angeles to Portland,” Bonta said. “This disrespect for the rule of law cannot stand — and I’m glad the court agreed.”

Newsom has ratcheted up his rhetoric about Trump in recent days: On Friday, Newsom lashed out at universities that may sign the president’s higher education compact, which demands rightward campus policy shifts in exchange for priority federal funding.

“I need to put pressure on this moment and pressure test where we are in U.S. history, not just California history,” Newsom said. “This is it. We are losing this country.”

The Associated Press contributed to this report.