The Supreme Court on Wednesday upheld Tennessee’s ban on gender-affirming care for transgender minors, a jolting setback to transgender rights.

The justices’ 6-3 decision in a case from Tennessee effectively protects from legal challenges many efforts by President Donald Trump’s Republican administration and state governments to roll back protections for transgender people. Another 26 states have laws similar to Tennessee’s.

In a dissent for the court’s three liberal justices that she summarized aloud in the courtroom, Justice Sonia Sotomayor wrote, “By retreating from meaningful judicial review exactly where it matters most, the court abandons transgender children and their families to political whims. In sadness, I dissent.”

The law also limits parents’ decision-making ability for their children’s health care, she wrote.