A federal appeals court on Tuesday unanimously sided with a transgender teen who is seeking access to the bathroom of his choice at his Wisconsin high school.

Senior Ashton Whitaker, 17, sued Kenosha Unified School District's policy of restricting transgender students to using separate bathrooms from their peers. A lower court in September ordered the school district to stop enforcing the policy.

A three-judge panel of the Seventh Circuit Court of Appeals upheld the district court's ruling, saying that Title IX of the Education Amendment of 1972, which bans sex discrimination in public schools, applies in the case.

“A policy that requires an individual to use a bathroom that does not conform with his or her gender identity punishes that individual for his or her gender non-conformance, which in turn violates Title IX,” wrote Circuit Judge Ann Claire Williams in a 35-page ruling. “Providing a gender-neutral alternative is not sufficient to relieve the School District from liability, as it is the policy itself which violates the Act.”

The decision sets a precedent in Wisconsin, Illinois and Indiana, the three states the court covers.

Ash, who graduates this weekend, praised the decision in a statement.

“After facing daily humiliation at school last year from being threatened with discipline and being constantly monitored by school staff just to use the bathroom, the district court’s injunction in September allowed me to be a typical senior in high school and to focus on my classes, after-school activities, applying to college, and building lasting friendships,” Ash said.

A lawyer for the Kenosha Unified School District told The Washington Post that his client had yet to decide whether it would appeal the ruling.