In a 31-page ruling on Tuesday, a federal district court in Virginia ruled that Gavin Grimm and other transgender students have equal protection under Title IX, the federal law banning sex discrimination in schools, and the Constitution.

“I feel an incredible sense of relief,” Grimm said in a statement issued by the ACLU. “After fighting this policy since I was 15 years old, I finally have a court decision saying that what the Gloucester County School Board did to me was wrong and it was against the law. I was determined not to give up because I didn’t want any other student to have to suffer the same experience that I had to go through.”

Grimm is the former Gloucester County high school student whose use of the boys’ bathroom set off a series of public debates surrounding trans students in schools — including graphic discussion of his genitals — that he has called “humiliating and painful.” In 2014, the school board adopted a new policy barring Gavin from using the boys’ restroom, and mandating that all students use restrooms that correspond to their “biological gender.”

The ACLU quickly took on Gavin’s case in 2015, and the case gained notoriety as it climbed through the courts. The U.S. Department of Justice, under the Obama administration, filed a motion of support in Grimm’s favor — announcing as a result that Title IX protects transgender students. The next year, in May 2016, the Obama administration sent new guidance to school districts across the country compelling them to adopt trans-inclusive policies when it comes to restrooms, locker rooms, and other facilities.

Grimm’s struggle climbed all the way to the Supreme Court, which in October 2016 agreed to take the case. But on March 6, 2017, just days before it was slated to hear oral arguments, SCOTUS reversed, said it would no longer take the case, and vacated the most recent court decision in Grimm’s favor.

After the Supreme Court announced that it would not hear Grimm’s case, the school board tried to get the case dismissed altogether from a lower court.

But on Tuesday, the Virginia District Court denied their request — and said in a ruling that forcing transgender students to use the wrong bathrooms is sex discrimination under Title IX.

In the lengthy ruling, the court says that Title IX should apply to trans students, pointing out that Title IX doesn’t include a definition of the term "sex," and says that while it’s “appealingly simple” to define sex as the difference between “boys and girls based on physical sex characteristics alone,” that’s just not how it works in the real world.

“How would the Board’s policy apply to individuals who have had genital surgery,” asks the court ruling, “Individuals whose genitals were injured in an accident, or those with intersex traits who have genital characteristics that are neither typically male nor female?”

The court also slammed the school board’s use of the term “biological gender” as the basis for its student bathroom policy, saying the “term has not been accepted by the medical community” and pointing out the difference between gender identity and physical characteristics.

The court ruling gives the Gloucester County School Board and Gavin Grimm 30 days to schedule a settlement discussion. If no agreement is reached, the case could continue to a U.S. Court of Appeals — and eventually make it back to the Supreme Court, after all.

Mary Emily O’Hara is a journalist covering LGBTQ+ breaking news for them.