Oregon officials are pushing back in court against President Donald Trump’s repeated efforts to send National Guard troops to Portland. And so far, they’re winning. A federal judge temporarily blocked Trump’s order to militarize the Oregon National Guard to defend federal immigration agents in Portland and—when Trump tried to get around that ruling—also stopped his effort to deploy the California National Guard to the city.[time-brightcove not-tgx=”true”]Trump’s efforts put the country on a path toward using the military for law enforcement, and Oregon challenged Trump in court to draw a “bright line,” Oregon Attorney General Dan Rayfield tells TIME. The protests outside the Immigration and Customs Enforcement building in the city don’t justify sending in the military, Rayfield says. “It’s foundational in our democracy that using the United States military in our cities is not normal. This is not a third-world country, and we felt that the President is on a path to normalize the use of the military in our cities.”Judge Karin Immergut of the Federal District Court for the District of Oregon ruled on Saturday that military assistance wasn’t necessary, as Justice Department lawyers argued it was, and temporarily stopped troops from deploying. “This is a nation of constitutional law, not martial law,” wrote Judge Immergut, who was appointed by Trump to the federal bench in 2018. The next day, when Trump tried to send in the California National Guard, Immergut blocked that too, saying Trump’s Justice Department was trying to go against her Saturday order. The judge scheduled a trial for October 29. The President is forbidden from using the military inside the U.S. for law enforcement purposes by the Posse Comitatus Act of 1878. The National Guard can be deployed to assist Americans during natural disasters and in times of insurrection or open revolt. Read more: Former Trump Aides Warn of Secret Presidential Crisis PowersWhen Trump was asked about her ruling later on Sunday, he seemed to express a belief that judges he nominated should be ruling in his favor. Trump told reporters that if his Administration put a judge like Immergut on the bench during his first term, “I wasn’t well-served by the people who picked judges.” Under the Constitution, federal judges are given lifetime appointments and put in a separate branch of government that is not controlled by the President in order to insulate them from political pressure. Rayfield, the Oregon attorney general, said it was “absurd” that Trump would “ignore the judge’s order.” Trump has since tried to mobilize National Guard troops from Texas and other states to send them to Oregon, Rayfield says.Trump senior advisor Stephen Miller wrote on X that Immergut’s ruling was “legal insurrection.” When TIME asked Miller if he is recommending President Trump take action against judges who make rulings he disagrees with, Miller said, “No, it’s simply a factually accurate statement that when a judge assumes for him or herself the powers that have been delegated by the Constitution to the President, that that is a form of illegal insurrection.”In Portland, Rayfield has encouraged protestors to not “take the bait” if provoked by federal law enforcement. “This is an issue that has been fabricated in the heads of the Trump Administration,” Rayfield says. “If the President is telling his folks to be more aggressive and they’re moving off of federal property to instigate interactions with peaceful protestors, we need have our protestors to not take the bait and to back off. Don’t play into their game.”