The Supreme Court ruled that parents can choose to have their children not read books with LGBTQ+ themes in public schools, the Washington Post reports.

In a 6-3 ruling, the court said that schools cannot compel schoolchildren to read the books if their parents have religious objections.

The case, Mahmoud v. Taylor, began when Maryland’s Montgomery County Public Schools changed its policy on LGBTQ+ storybooks to prohibit parents from opting their children out of reading the books. Six parents sued the school district over the policy.

The books in question include Pride Puppy!, written by Robin Stevenson and illustrated by Julie McLaughlin; Prince & Knight, written by Daniel Haack and illustrated by Stevie Lewis; and My Rainbow, written by Trinity Neal and DeShanna Neal and illustrated by Art Twink.

In the opinion, Justice Samuel Alito wrote, “The Board’s introduction of the ‘LGBTQ+-inclusive’ storybooks, along with its decision to withhold opt outs, places an unconstitutional burden on the parents’ rights to the free exercise of their religion.”

Justice Sonia Sotomayor wrote in a dissent, “The result will be chaos for this Nation’s public schools. Requiring schools to provide advance notice and the chance to opt out of every lesson plan or story time that might implicate a parent’s religious beliefs will impose impossible administrative burdens on schools. The harm will not be borne by educators alone: Children will suffer too.”

The authors and illustrators of the books released a statement via the literary nonprofit organization PEN America, writing, “To treat children’s books about LGBTQ+ characters differently than similar books about non-LGBTQ+ characters is discriminatory and harmful. This decision will inevitably lead to an increasingly hostile climate for LGBTQ+ students and families, and create a less welcoming environment for all students.”

Michael Schaub is a contributing writer.