The US Court of Appeals for the 9th Circuit handed down a mixed-bag ruling on Wednesday for the Trump administration, which has tried to punish cities and counties that don’t help federal agents deport undocumented immigrants.

On the downside for President Donald Trump, the court’s 2–1 ruling found Executive Order 13768, which made so-called sanctuary cities ineligible for certain federal grants, was unconstitutional.

The 9th Circuit is the highest court to date to rule on the policy, which Trump issued days after taking office in 2017. In doing so, the appeals court upheld a lower court’s decision that the policy likely violated the Fifth Amendment’s Due Process Clause for its vagueness and the 10th Amendment’s ban on “commandeering” local jurisdictions to enforce federal law.

But on the other hand, the court delivered a win on Wednesday to Attorney General Jeff Sessions.

In its decision, the 9th Circuit undid the lower court’s nationwide preliminary injunction — which had blocked Trump’s order from taking effect across the country — by vacating that portion of the opinion. Instead, the decision Wednesday suggested the injunction, in light of the evidence presented thus far, may only apply to the plaintiffs who brought the case last year (the city of San Francisco, San Francisco County, and Santa Clara County, California). The case was remanded to the lower court for further review.

Sessions has railed against nationwide injunctions over the past year, lambasting judges as veritable lawbreakers for supposedly overstepping their authority with rulings that hamstring policies from coast to coast. He’s argued lower courts may only block policies insofar as they apply to the party that brought the lawsuit — in this latest case, San Francisco and Santa Clara, so Sessions got what he wanted.

A Justice Department spokesperson told BuzzFeed News that "the court’s decision to vacate the nationwide injunction is another major victory for the rule of law. When courts issue nationwide injunctions and order relief beyond the scope of a particular lawsuit, they overstep their role and improperly limit the government from functioning.”

But the decision, as it pertains to San Francisco and Santa Clara, the official added, “is a victory for criminal aliens in California, who can continue to commit crimes knowing that the state’s leadership will protect them from federal immigration officers whose job it is to hold them accountable and remove them from the country.”

San Francisco saw the 9th Circuit ruling as a win and a “check” on a power grab by the administration. “This is a victory for the rule of law. The Constitution is clear: Congress has the power of the purse and the power to legislate. The president does not. No president can seize that power, like this one tried to do,” said San Francisco City Attorney Dennis Herrera. “The only way to stop a bully is to stand up to him. That’s what San Francisco has done, and that’s what we will continue to do.”

In April, 2017, US District Court Judge William H. Orrick ruled that the executive order caused those three plaintiffs “constitutional injuries by violating the separation of powers doctrine and depriving them of their Tenth and Fifth Amendment rights, but also because the Order has caused budget uncertainty by threatening to deprive the Counties of hundreds of millions of dollars in federal grants that support core service.”

On appeal, the 9th Circuit agreed that provisions of Trump’s order are unconstitutional and that the plaintiffs were entitled to be exempt while the case continues to be litigated in a lower court.

However, the 9th Circuit also held, in an opinion by Chief Judge Sidney R. Thomas, that the record of the case is “insufficiently developed as to the question of the national scope of the injunction.”

“We vacate the injunction to the extent that it applies outside California and remand to the district court for a more searching inquiry into whether this case justifies the breadth of the injunction imposed,” the opinion stated, while also noting that nationwide injunctions are still within the purview of lower courts. “We are unpersuaded by the Administration’s arguments in favor of a blanket restriction on all nationwide injunctions.”

The combination of messages seems to leave open the possibility that the plaintiffs could present more facts at the trial court that show a renewed nationwide injunction is warranted.

The Justice Department is currently involved in other lawsuits over sanctuary jurisdictions in California, Philadelphia, and Chicago — in addition to a lawsuit filed in July by six other states.