(CNN) -- The Supreme Court ruled in favor of a former high school cheerleader who argued that she could not be punished by her public school for posting a profanity-laced caption on Snapchat when she was off school grounds.
The case involving a Pennsylvania teenager was closely watched to see how the court would handle the free speech rights of some 50 million public school children and the concerns of schools over off-campus and online speech that could amount to a disruption of the school's mission or rise to the level of bullying or threats.
The 8-1 majority opinion was penned by Justice Stephen Breyer.
"It might be tempting to dismiss (the student's) words as unworthy of the robust First Amendment protections discussed herein. But sometimes it is necessary to protect the superfluous in order to preserve the necessary," Breyer wrote.
Breyer said that the court has made clear that students "do not shed their constitutional rights to freedom of speech or expression even 'at the school house gate.'"
"But," he said, "we have also made clear that courts must apply the First Amendment in light of the special characteristics of the school environment."
"The school itself has an interest in protecting a student's unpopular expression, especially when the expression takes place off campus. America's public schools are the nurseries of democracy," the opinion read.
Outburst from JV cheerleader
"F--k school f--k softball f--k cheer f--k everything" Brandi Levy, then 14, wrote in 2017. She was reacting to the fact that as a junior varsity cheerleader she had failed to get a spot on the varsity squad at Mahanoy Area High School in Mahanoy City, Pennsylvania.
When school officials learned of the outburst, Levy was suspended from the JV team for having violated school rules. But her lawyers sued, alleging the school had violated her freedom of speech. Levy is now 18 and a freshman at Bloomsburg University.
Levy lauded the justices' decision on Wednesday, saying in a statement: "The school went too far, and I'm glad that the Supreme Court agrees."
"Young people need to have the ability to express themselves without worrying about being punished when they get to school," she said. "I never could have imagined that one simple snap would turn into a Supreme Court case, but I'm proud that my family and I advocated for the rights of millions of public school students."
Dissent from Thomas
Justice Clarence Thomas dissented, writing that students like the former cheerleader "who are active in extracurricular programs have a greater potential, by virtue of their participation, to harm those programs."
"For example, a profanity-laced screed delivered on social media or at the mall has a much different effect on a football program when done by a regular student than when done by the captain of the football team. So, too, here," Thomas wrote.
Justices grappled with where to draw a line
Steve Vladeck, CNN Supreme Court analyst and professor at the University of Texas School of Law, said Wednesday's ruling is a "rare win" for students in speech cases at the Supreme Court.
"Today's decision may seem obvious to those who have a hard time seeing why public schools should be able to regulate any and all off-campus speech by students, but the fact that the court is identifying circumstances in which they can't is actually a big deal," Vladeck said.
"Although the line between the off-campus speech that schools can and can't regulate is less than clear, the fact that there is a line will have significant ramifications for just about all public school administrators going forward. It's a rare win for a student in a speech case before the current court," he added.
At oral arguments, several of the justices struggled with where they could draw the line if they allowed schools to discipline students for speech directed at the school that occurs off-campus.
Breyer, for example, acknowledged that Levy used "unattractive swear words," but he questioned whether it caused a "material and substantial disruption" to the school.
"I don't see much evidence it did," he said, noting that teenagers, when talking to each other, often swear when they are off-campus.
"I mean, my goodness, every school in the country would be doing nothing but punishing," Breyer said.
David Cole, an American Civil Liberties Union lawyer for Levy, said that his client was "merely expressing frustration with a four-letter word to her friends outside of school on a weekend." She wasn't sending a threat or an attempt to bully another student.
"The message may seem trivial, but for young people, the ability to voice their emotions to friends without fear of school censorship may be the most important freedom of all," he said.
Lisa Blatt, a lawyer for the Mahanoy Area School District, told the justices that the line should be drawn not based on where the speech occurred, but on whether it caused a substantial disruption to the school.
"Off-campus speech, particularly on social media can be disruptive," she said, because of the internet's "ubiquity, instantaneous and mass dissemination."
Levy's case drew the support of Mary Beth and John Tinker, who won a landmark school speech case in 1969 that allowed them to wear a black armband on campus to protest the Vietnam War.
The high court held then that students do not shed "their constitutional rights to freedom of speech or expression at the schoolhouse gate," but said that some speech on school grounds could be could be punished.
The justices took into consideration the special characteristics of a school environment and said that public school officials could regulate speech that would "materially and substantially interfere with the requirements of appropriate discipline in the operation of the school." The opinion, however, dealt only with speech on school grounds related to the school.
Levy won in the lower courts. A district court found that the school had not shown that she waived her speech rights as a condition of joining the cheerleading team. A federal appeals court affirmed, relying on the fact that the speech hadn't occurred in the campus environment which would include school-sponsored events and field trips.
Breyer disagreed with the reasoning of a lower court opinion that held that a school could never regulate speech that takes place off campus, but at the same time he declined to set forth what he called "a broad, highly general First Amendment rules stating just what counts as 'off-campus speech."
Instead, he allowed that while the cheerleader's post were "crude" they "did not amount to fighting words." He said that while she used "vulgarity" her speech was not "obscene."
In addition, her post appeared "outside of school hours from a location outside of school" and they did not target any member of the school community with "abusive" language. He added that she used her own personal cellphone and her audience consisted of a private circle of Snapchat friends. Breyer said "these features of her speech" diminish the school's interest in punishing her.
This story has been updated with additional details Wednesday.
™ & © 2021 Cable News Network, Inc., a WarnerMedia Company. All rights reserved.