The Supreme Court on Tuesday ruled 6-3 to uphold state laws that bar transgender girls and women from competing on female school sports teams, rejecting challenges to bans in West Virginia and Idaho. Justice Brett Kavanaugh wrote the majority opinion, holding that the bans do not violate federal civil-rights law.

Kavanaugh wrote that “starting down the road of judicially managed individualized exemptions based on physical capabilities of individual athletes could fundamentally undermine women’s and girls’ sports — especially if the number of biological males who seek to play women’s and girls’ sports increases significantly over time.” He added that “the questions would be endless (and bitter) and yield few, if any, principled answers.”

The case originated with Becky Pepper-Jackson, who was 11 years old when she wanted to run cross-country in middle school in West Virginia five years ago. The ACLU represented her, arguing that the state’s ban was too broad, covering every age, kind of sport, level of competition, and stage of gender transition. Joshua Block, the ACLU senior counsel who represented Pepper-Jackson, said, “I think there’s been a real backsliding over the past five years, not just specifically in the context of sports, but in terms of discrimination against trans people in general, and vitriol.”

The ruling leaves transgender girls and women eligible to play on K-12 school teams in 23 states. But the Trump administration and conservative groups said they would press to end those policies. The Justice Department’s Civil Rights Division is already suing California and Minnesota over the issue. Assistant Attorney General Harmeet Dhillon said on Newsmax after the opinion was issued, “We will be definitely alerting those courts to this new development.”

The decision caps a five-year period during which courts and legislatures moved to restrict transgender athletes’ participation in female sports. The Supreme Court’s 2020 workplace discrimination decision, which established that federal civil-rights law prohibits employers from discriminating against workers on the basis of gender identity or sexual orientation, now appears as a high-water mark for the movement rather than a sea change. In the past 13 months, transgender advocates have taken five other significant losses at the court, including on the Trump administration’s ban on transgender troops, “conversion therapy” for minors, parental notification when students adopt new pronouns in school, and sex identification on passports.

The biggest defeat, the Wall Street Journal reported, came when the high court ruled that states like Tennessee could restrict transgender healthcare treatment for minors. The decision did not preclude states from allowing such treatments, but the administration has pressed ahead with threats to investigate and cut off funds to healthcare providers treating minors. Some hospitals that were previously providing treatment in states where it remains fully legal have stopped.

Raúl Labrador, Idaho’s Republican attorney general, said, “Today most people look at this and they can’t believe what we were going through six years ago.”

In the five years since Pepper-Jackson filed her lawsuit, international sports federations governing swimming and track tightened their rules to bar athletes who have undergone male puberty from competing in top women’s events. World Boxing introduced mandatory genetic sex tests after a dispute over two athletes’ eligibility at the 2024 Paris Olympics. In March, Olympic leaders announced screening for every female competitor at the 2028 Games in Los Angeles.

In the final weeks of his campaign, Trump repeatedly highlighted the boxing controversy, as did other Republican candidates. In office, he shifted the federal government’s thinking on Title IX, the federal law barring sex-based discrimination in educational activities. To the Biden administration, Title IX protected access for transgender students. To the Trump administration, it is about safety and equal opportunities for biologically female students.

Trump issued an executive order last year seeking to withhold funding from schools and states that allow transgender women and girls to compete in female categories. The NCAA immediately barred transgender women from playing on college women’s teams. The U.S. Olympic Committee also prohibited transgender athletes from competing in women’s categories in sports under its umbrella — including at adult recreational competitions.

The Supreme Court’s decision on Tuesday is the latest in a series of rulings that have reshaped the legal landscape for transgender rights.