On Friday, U.S. District Judge Thomas D. Schroeder ruled on the legality of North Carolina’s HB2, a wide-reaching anti-LGBTQ law. The result is a partial success for HB2’s critics—especially with regard to HB2’s requirement that universities discriminate against transgender students and employees. But the ruling also suggests that Schroeder, a George W. Bush appointee, is skeptical of the plaintiffs’ broader claims about HB2’s unconstitutionality. The upshot is that HB2’s legal opponents have a fair amount to celebrate—and a lot more work to do.

Schroeder rendered a judgment on two central challenges to the North Carolina law: First, that it violates federal law; and second, that it violates the Equal Protection Clause of the 14th Amendment. The Department of Education currently interprets Title IX’s ban on “sex discrimination” to encompass anti-trans discrimination, including the exclusion of trans people from the bathroom that aligns with their gender identity. Through this interpretation, the DOE has found that federally funded schools may not prevent trans people from using their preferred bathroom. Yet HB2 explicitly prevented trans people from using the bathroom at school unless they altered their birth certificate, which is impossible in some states.

The U.S. Court of Appeals for the 4th Circuit has affirmed the legitimacy of the DOE’s interpretation of Title IX. As a district court judge within the 4th Circuit, Schroeder is bound by that determination. Thus, he adhered to it in his ruling, holding that HB2 cannot be used to prevent trans university students from using the bathroom that corresponds with their gender identity. This judgment is, in itself, a considerable victory against HB2. The law applied only to government buildings, and a huge proportion of government buildings are located on university campuses. Schroeder’s decision further solidifies the widespread sentiment that HB2 represented an unjustifiable interference into higher education.

But Schroeder’s ruling on the equal protection challenge was vastly more favorable to the state. Schroeder found, correctly, that HB2—which categorizes citizens based on their “biological sex”—constitutes sex discrimination, requiring intermediate scrutiny. He explains that this standard requires HB2 to be “substantially related to an important government interest,” or it violates the Equal Protection Clause. Schroeder concludes that “protection of bodily privacy is an important government interest,” satisfying the test’s first prong. He then writes that the question of whether HB2 is “substantially related” to that interest requires him to decide whether “sex” means “physiological differences between men and women” or “differences in gender identity.”

Schroeder decides that the Supreme Court defined “sex” as “physiological differences” in United States v. Virginia when it ruled that women must be allowed entrance into the Virginia Military Institute. He also found that 99.7 percent of Americans’ “biological sex” aligns with their gender identity. Because the law “classifies individuals with 99.7% accuracy,” he writes, it is a “reasonable fit” and satisfies intermediate scrutiny.*

Here is where I think Schroeder’s decision clearly diverges from precedent. His description of intermediate scrutiny as it applies to sex discrimination is outdated; in the very case he cites, U.S. v. Virginia, the court elevated the standard, declaring that “[p]arties who seek to defend gender based government action must demonstrate an ‘exceedingly persuasive justification’ for that action.” Yet Schroeder does not cite this standard at all—and if he had, I suspect he would have struggled to articulate North Carolina’s “exceedingly persuasive justification” for excluding trans people from government bathrooms. I expect this portion of his opinion to be overturned on appeal at the left-leaning 4th Circuit.

Schroeder then asks for more briefing on a few due process–related issues and enjoins the enforcement of HB2—exclusively as to the university plaintiffs who brought this case. That’s very strange, and it will also likely be altered at the 4th Circuit, which should halt HB2’s enforcement against every university student and employee. Still, this very conservative judge should be lauded for granting an injunction at all. Toward the end of his decision, Schroeder delivers a clear-eyed assessment of HB2’s effect on trans people:

Rather than protect privacy, it appears at least equally likely that denying an injunction will create privacy problems, as it would require the individual transgender Plaintiffs, who outwardly appear as the sex with which they identify, to enter facilities designated for the opposite sex (e.g., requiring stereotypically-masculine appearing transgender individuals to use women’s bathrooms), thus prompting unnecessary alarm and suspicion.

He also affirms the plaintiffs’ assertion that trans people are not, contrary to HB2’s implication, sexual predators who pose some terrible safety hazard to the public at large:

There is no evidence that transgender individuals overall are any more likely to engage in predatory behaviors than other segments of the population. In light of this, there is little reason to believe that allowing the individual transgender Plaintiffs to use partitioned, multiple occupancy bathrooms corresponding with their gender identities, as well as UNC to seek to accommodate use of similar showers and changing facilities, will pose any threat to public safety, which will continue to be protected by the sustained validity of peeping, indecent exposure, and trespass laws.

HB2’s opponents should consider this a hard-won victory, albeit a partial one—and expect even more good news from the 4th Circuit in the coming months.

*Correction, Aug. 29, 2016: This post originally misquoted the ruling’s “reasonable fit” analysis. The decision stated that the law satisfies intermediate scrutiny, not strict scrutiny.