A divided U.S. Supreme Court has sided with religious parents who want to pull their children out of the classroom when a public school lesson uses LGBTQ-themed storybooks.

The 6-3 decision Friday in a case brought by parents in Maryland comes as certain books are increasingly being banned from public schools and libraries.

In Justice Samuel Alito’s majority opinion — joined by the rest of the court’s conservatives — he wrote that the lack of an “opt-out” for parents places an unconstitutional burden on their rights to religious freedom.

Justice Sonia Sotomayor wrote in dissent for the three liberal justices that public schools expose children to different views in a multicultural society.

“That experience is critical to our Nation’s civic vitality,” she wrote. “Yet it will become a mere memory if children must be insulated from exposure to ideas and concepts that may conflict with their parents’ religious beliefs.”

Here’s what to know about the case and its potential impacts:

What happens next

The decision was not a final ruling in the case. It reversed lower-court rulings that sided with the Montgomery County school system, which introduced the storybooks in 2022 as part of an effort to better reflect the district’s diversity.

At first, the school district allowed parents to opt their children out of the lessons for religious and other reasons, but the district later reversed course, saying it became disruptive. The move prompted protests and eventually a lawsuit.

Now, the case goes back to the lower court to be reevaluated under the Supreme Court ‘s new guidance. But the justices strongly suggested that the parents will win in the end.

The court ruled that policies like the one at issue in this case are subjected to the strictest level of review, nearly always dooming them.

The ruling could have national implications for public education

Jessica Levinson, a law professor at Loyola Law School in Los Angeles, said the court’s ruling could inspire similar lawsuits in other states.

“I think any school district that reads similar books to their children is now subject to suit by parents who don’t want their kids to hear these books because it substantially interferes with their religious beliefs,” she said.

Whether it could open the door to broader legal challenges remains to be seen.

Levinson said the majority opinion’s emphasis on the content of the books at the center of the case, including “Uncle Bobby’s Wedding,” a story about a two men getting married, could narrow its impact.

“The question that people will ask,” Levinson said, “is if this could now allow parents to say, ‘We don’t want our kids to learn about certain aspects of American history.’ “

LGBTQ rights advocates slam court ruling

Adam Zimmerman, who has two kids in school in Montgomery County, Maryland, called the ruling abhorrent.

“We need to call out what’s being dressed up as religious faith and values and expose it for the intolerance that it really is,” he said.

Zimmerman has lived in Montgomery County for 16 years and wanted to raise his son and daughter there, in large part, because of the school district’s diversity. It was important to him, he said, that his kids be exposed to people from all walks of life.

“It’s a beautiful thing, and this ruling just spits on that diversity,” he said.

Other rights groups described the court’s decision as harmful and dangerous.

“No matter what the Supreme Court has said, and what extremist groups are advocating for, book bans and other censorship will not erase LGBTQIA+ people from our communities,” said Fatima Goss Graves, CEO and president of the National Women’s Law Center.