A Minnesota appeals court ruled Monday a school district cannot bar students who claim to identify as the opposite sex from using bathrooms and locker rooms consistent with their gender identity.

The Minnesota Court of Appeals ruled in favor of parents who sued the Anoka-Hennepin School District in 2019, claiming their biological daughter, who identifies as a boy, was required to use a separate locker room when she joined the Coon Rapids High School boys’ swim team.

The court ruled a separate locker room based on sex is discriminatory, according to the Minnesota Human Rights Act, which prohibits discrimination based on race, religion, sexual orientation, and gender identity.

The Minnesota Department of Human Rights had intervened in the lawsuit and celebrated the ruling.

“This decision means that schools are now safer and more welcoming for transgender and gender nonconforming students across Minnesota,” said Department of Human Rights Deputy Commissioner Irina Vaynerman. “Our state was the first in the nation to prohibit gender identity discrimination. Today’s decision honors that legacy and continues to build a more equitable and inclusive Minnesota.”

In a press statement published by the Minnesota chapter of the American Civil Liberties Union, the student, identified as N.H., said:

I never want any student to experience the discrimination and cruelty I experienced from the adults at my school. It means a lot to see that courts protect transgender students like me. Today’s decision makes it very clear that segregating trans students doesn’t just dehumanize us, it violates our legal rights.

According to the court summary, the girl was permitted to use the boys’ locker room during her freshman year on the swim team, but, near the end of the season, the district notified her that she would have to use the girls’ locker room.

Later that same day, the school district retracted its decision. According to the summary, N.H. was hospitalized four days later due to mental health issues.

The ruling, written by Judge Peter Reyes, who was appointed by Gov. Mark Dayton (D), states:

Here, the school district prohibited N.H., a transgender male, from using the boys’ main locker room. The school district constructed an additional enhanced-privacy locker room separate from the main facility and required N.H. to use it because he is transgender. Applying the plain language of the statute, we conclude that requiring a transgender student to use a different locker-room facility because of his sexual orientation is discrimination under Minn. Stat. § 363A.13, subd. 1.

As N.H. argues, the overwhelming majority of federal courts that have recently examined transgender education-discrimination claims under Title IX have concluded that preventing a transgender student from using a school restroom or locker room consistent with the student’s gender identity violates Title IX.

Judge Matthew Johnson, an appointee of former Minnesota Gov. Tim Pawlenty (R), dissented.

“This court has held that men and women are not similarly situated for purposes of an equal-protection claim if governmental action legitimately depends on differences in their respective anatomies.” Johnson wrote and added, “N.H.’s complaint claim does not state a claim on which relief can be granted because N.H. was not similarly situated in all relevant respects to the cisgender boys in [her] gym class.”