An agreement has been reached in the case of a transgender student who was seeking access to the bathroom of his choice at his Wisconsin high school.

Ashton Whitaker, who has since graduated high school, sued Kenosha Unified School District over its policy of restricting transgender students to using separate bathrooms from their peers. A lower court in September, 2016 ordered the school district to stop enforcing the policy. The school district turned to the U.S. Seventh Circuit Court of Appeals, which also sided with Whitaker.

A three-judge panel said that Title IX of the Education Amendment of 1972, which bans sex discrimination in public schools, applies in the case, marking the first time that a federal appellate court took such a stance.

“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 school district appealed the ruling to the U.S. Supreme Court. But as a condition of the settlement announced this week, which remains subject to court approval, the school district agreed to withdraw its petition before the high court.

If the settlement is approved by the court, it means that in Wisconsin, Illinois and Indiana, the three states the appeals court covers, public schools must allow transgender students access to restrooms consistent with their gender identity. It also means that the Supreme Court will not get to weigh in on the issue.

Whitaker said in a statement that he's “deeply relieved” by the settlement.

“Winning this case was so empowering and made me feel like I can actually do something to help other trans youth live authentically,” Whitaker said. “My message to other trans kids is to respect themselves and accept themselves and love themselves. If someone’s telling you that you don’t deserve that, prove them wrong.”

Whitaker was represented by the San Francisco-based Transgender Law Center.

"KUSD’s discriminatory actions included banning Ash from using boys’ restrooms, invasively monitoring his restroom use, referring to him by female pronouns in front of other students, initially denying him the right to run for junior prom king, and forcing him to room by himself during a week-long orchestra camp,” the Transgender Law Center said in a statement. “To avoid punishment, Ash tried to avoid using the bathroom at school altogether, and suffered serious depression, anxiety, and other physical and educational harms as a result of the discrimination he faced."

As part of the settlement, the school district must pay $800,000 to Whitaker and reasonable attorneys' fees.

“This settlement sends a clear message that schools are responsible for treating transgender students fairly and equally, without exception,” Masen Davis, CEO of the LGBT group Freedom for All Americans, said in a statement.