A federal appeals court on Tuesday overturned a West Virginia law that prohibited transgender girls from competing against biological girls in sports.

The 2-1 ruling came from the 4th U.S. Circuit Court of Appeals. The ruling found the law violated Title IX – in favor of the American Civil Liberties Union, its West Virginia chapter and Lambda Legal.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Transgender pride flag

A federal appeals court struck down West Virginia's transgender sports ban. (ALLISON DINNER/AFP via Getty Images)

The court said the law cannot be applied to Becky Pepper-Jackson, a 13-year-old girl who had been taking puberty blockers and has identified as a girl since the third grade.

"This is a tremendous victory for our client, transgender West Virginians, and the freedom of all youth to play as who they are," ACLU West Virginia attorney Joshua Block said.

West Virginia’s "Save Women’s Sports Act" was signed into law in 2021. The law ordered student-athletes to compete and play against those of their biological gender. Lawyers for the girl originally had sued the school board after Gov. Jim Justice signed the bill into law, claiming it violated the 14th Amendment and protections under Title IX.

OREGON HIGH SCHOOL TRANSGENDER TRACK ATHLETE COMPETES AGAINST GIRLS AT EVENT, SPARKING OUTRAGE ON SOCIAL MEDIA

Gov. Jim Justice

West Virginia Gov. Jim Justice signed the bill in 2021. (AP Photo/Chris Jackson, File)

U.S. District Judge Joseph Goodwin ruled against the transgender girl in January 2023 and also ruled the laws did not violate Title IX protections. However, the 4th U.S. Circuit Court of Appeals ruled 2-1 to reinstate a preliminary injunction.

The Supreme Court ruled last April that the transgender girl could compete with biological girls on the middle school’s girls' sports teams. Supreme Court justices refused to disturb an appeals court order that made it possible for the girl to continue playing on her school’s track and cross-country teams. Justices Samuel Alito and Clarence Thomas dissented from the decision.

West Virginia was one of at least 24 states that had laws barring transgender women and girls from competing against the gender they identify as.

CLICK HERE TO GET THE FOX NEWS APP

"I will keep fighting to safeguard Title IX. We must keep working to protect women’s sports so that women’s safety is secured and girls have a truly fair playing field," West Virginia Attorney General Patrick Morrisey said. "We know the law is correct and will use every available tool to defend it."

The Associated Press contributed to this report.

Follow Fox News Digital’s sports coverage on X and subscribe to the Fox News Sports Huddle newsletter.