On Friday, a federal appeals court overturned a lower court ruling declaring that Donald Trump’s ban on transgender military service is unconstitutional. Its decision might seem like a setback for the service members challenging the policy—but it’s actually a qualified victory for transgender rights with sweeping ramifications in other cases.

After Trump announced his ban on trans military service via tweet in July 2017, four federal judges issued injunctions prohibiting its implementation. All four courts found the policy to be an unjustified violation of transgender Americans’ equal protection rights. In January, however, the Supreme Court lifted two of those injunctions by a 5–4 vote while the government appeals the rulings. The other two injunctions were eventually lifted in light of SCOTUS’s order, allowing the Pentagon to implement the ban. Meanwhile, appeals courts have continued to mull the policy’s constitutionality.

The 9th U.S. Circuit Court of Appeals finally issued its decision on the matter Friday, vacating U.S. District Judge Marsha J. Pechman’s 2018 ruling against the ban. This outcome in Karnoski v. Trump is no surprise, since the Supreme Court already lifted Pechman’s injunction. The 9th Circuit found that Pechman hadn’t properly assessed whether former Defense Secretary James Mattis’ final implementation plan shored up the legality of the ban by providing the “considered military judgment” absent from Trump’s impromptu tweets and the resulting scramble to rationalize them. Its decision in Karnoski also found that Pechman had improperly applied strict scrutiny, thereby giving insufficient deference to the commander in chief.

But the 9th Circuit didn’t stop there. It went on to explain that the trans ban does discriminate against transgender people—a fact contested by the administration, which insists that the policy only discriminates against people with gender dysphoria. (This distinction makes no sense.) Moreover, the court found that discrimination on the basis of transgender status constitutes sex-based discrimination and is therefore subject to intermediate scrutiny. That means anti-trans policies must be supported by an “exceedingly persuasive justification,” one not “hypothesized or invented post hoc in response to litigation.” It directed Pechman to apply this test to the trans troops ban.

What “exceedingly persuasive justification” might lie behind this policy? The Trump administration asserts that transgender service members “undermine readiness,” “erode reasonable expectations of privacy,” and “impose disproportionate costs.” These claims are demonstrably false. We know that because trans troops could already serve openly when Trump announced his ban, and none of these problems arose. These excuses were cooked up by anti-LGBTQ advocates in response to litigation against the ban, precisely what intermediate scrutiny forbids. The Trump administration’s justifications cannot be “exceedingly persuasive” if they are ungrounded in reality, discredited by experts, and disproved by experience.

Thus, Pechman is almost certain to conclude that the ban remains unconstitutional. In the meantime, Karnoski establishes precedent in the 9th Circuit, confirming that transgender discrimination is subject to intermediate scrutiny. The court will now apply this test to other trans cases—including Arizona’s effort to exclude transition-related care from its state health plan. ACLU attorney Joshua Block noted on Friday that he’ll cite this development in his effort to block Arizona’s discriminatory exclusion in court. Karnoski may also compel the 9th Circuit to rule that prisons must provide transition-related care to inmates in a case currently pending before the court.

The 9th Circuit encompasses Alaska, Arizona, California, Guam, Hawaii, Idaho, Montana, Nevada, the Northern Mariana Islands, Oregon, and Washington. Following Karnoski, any anti-trans law passed by these states and territories must survive intermediate scrutiny. Few will be able to clear this high bar. Yes, the Supreme Court’s conservatives may ultimately issue a devastating decision writing transgender people out of the Constitution if and when these cases come back to SCOTUS. They could also undermine the logic of Karnoski in next term’s LGBTQ employment discrimination cases; anything is possible with this far-right bloc in control. But until then, trans people in a huge chunk of the country will enjoy heightened protections against unjust discrimination.