CHARLESTON, W.Va. (WBOY) — A state law that requires athletes to participate in sports based on their biological sex has been upheld in the U.S. District Court in the Southern District of West Virginia.

The case against HB 3293, also known as the “Save Women’s Sports Bill,” involved an 11-year-old transgender girl who wished to compete on the Bridgeport Middle School cross country and track teams. According to the bill, the student, named B.P.J. in the court’s ruling, would not be allowed to try out for the female teams due to language in the bill making “participation for sports events to be based on biological sex of the athlete at birth.”

The ruling, released Thursday, upheld the law and found that, although gender is separate and distinct from biological sex, “Classifications based on gender identity serve no legitimate relationship to the State of West Virginia’s interest in promoting equal athletic opportunities for the female sex,” and that “Classifications of teams according to biological sex is necessary to promote equal athletic opportunities for the female sex.”

According to the ruling, the law requires all school-sponsored teams to be classified as male, female or coed “based on biological sex.”

In a release sent Thursday, West Virginia Attorney General Patrick Morrisey supported the ruling.

“This short and simple law demands that girls and women get their fair share of opportunities in education, and Title IX’s regulations make it clear that this could be accomplished in school athletic programs by having ‘separate teams for members of each sex’ where the teams are based on competitive skill.”

West Virginia Attorney General Patrick Morrisey

There are currently 18 states, including West Virginia, that have laws that ban transgender students from competing in sports based on their gender identity.

The complete ruling can be viewed here.