FILE - In this Aug. 25, 2015 file photo, Gavin Grimm poses on his front porch during an interview at his home in Gloucester, Va. U.S. District Court Judge Robert G. Doumar ruled Thursday, June 2, 2016, that the Gloucester County School Board must allow Grimm to use the bathroom that matches his gender identity while the case is being litigated in court. Photo: AP Photo/Steve Helber, File

FILE - In this Aug. 25, 2015 file photo, Gavin Grimm poses on his front porch during an interview at his home in Gloucester, Va. U.S. District Court Judge Robert G. Doumar ruled Thursday, June 2, 2016, that the Gloucester County School Board must allow Grimm to use the bathroom that matches his gender identity while the case is being litigated in court. Photo: AP Photo/Steve Helber, File

A federal district court ruled in favor of Gavin Grimm, a transgender boy who sued his school district in 2016 when he was told he couldn’t use the boys’ bathrooms.

The court directed the school district to come up with an agreement with Grimm.

“I feel an incredible sense of relief,” said Grimm. “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.”

The U.S. District Court of the Eastern District of Virginia ruled that Grimm had a claim under Title IX, which bans discrimination on the basis of sex in schools.

Citing other federal court rulings that have held that bans on sex discrimination also ban discrimination on the basis of sex stereotypes, the court ruled that discrimination against transgender students was actionable under Title IX.

This ruling directly contradicts the Trump Administration’s interpretation of Title IX, which is that it only bans discrimination against cisgender boys or girls and schools are free to discriminate against transgender students.

Grimm, who identified as male since a young age, started using the boys’ restroom when he was a sophomore at Gloucester High School after he got permission from the principal. He used the boys’ restroom for several months without incident, but then some adults complained.

The school board held a meeting where Grimm was called a “freak” and compared to a dog that urinates on fire hydrants. The board passed a decision that banned him from using the boys’ restroom and required the school to come up with an alternative bathroom for him, so they converted a broom closet into a “unisex bathroom.”

Grimm sued the school board, saying that his rights under Title IX were violated. Title IX bans schools from discriminating on the basis of sex, which the Obama Administration interpreted as including discrimination against transgender students.

The school board tried to dismiss his claim, but a federal appeals court ruled that Title IX is ambiguous and deferred to the Obama Administration’s interpretation. The Supreme Court agreed to hear the case.

But then the Trump Administration rescinded the Obama Administration’s interpretation of Title IX last year, so the Supreme Court said it wouldn’t hear the case anymore and the school board tried to get Grimm’s claim dismissed.

“The district court has upheld what Gavin argued all along, that trans students deserve the same protections under Title IX as any other student and can’t be stigmatized and ostracized just because of who they are,” said Claire Guthrie Gastañaga, executive director of the ACLU of Virginia.