The Supreme Court ruled Tuesday that state bans on transgender women in school sports are lawful, a landmark decision that marks the 6-3 conservative court's latest erosion of LGBTQ rights.

Protesters wave transgender pride flags outside the Supreme Court as it hears arguments over state laws barring transgender girls and women from playing on school athletic team on Jan. 13.

The Supreme Court ruled laws that restrict school sports based on biological sex are lawful, with the court’s three liberal justices both agreeing and dissenting with parts of the opinion.

The court considered two cases on state laws in Idaho and West Virginia that restricted transgender girls and women from participating in female sports in public schools, including universities, and whether such state laws more broadly violate the Constitution’s Equal Protection Clause.

The laws outlaw biological males from participating on student sports teams that are “designated for females, women, or girls,” blocking transgender women from being on those teams.