The Supreme Court ruled in favor of a former Pennsylvania high school student, deciding that the school violated her First Amendment rights when it penalized her for using profane language to criticize the school on social media when she wasn’t on school grounds.

Mahanoy Area High School suspended then-student Brandi Levy—who’s now attending college—from her junior varsity cheerleading team when she used curse words in reference to the school on Snapchat, per CNBC.

“Fuck school fuck softball fuck cheer fuck everything,” Levy wrote in her first Snapchat post, alongside a photo of her and her friend flipping off the camera.

In a second post, she wrote, “Love how me and [another student] get told we need a year of jv before we make varsity but tha[t] doesn’t matter to anyone else?” 

The Supreme Court upheld a decision from the 3rd Circuit Appeals Court, which had ruled in Levy’s favor. The lower court cited a 1969 court decision, which said public schools couldn’t monitor certain speech since it happened off campus. The Supreme Court took a different view, writing that, “While public schools may have a special interest in regulating some off-campus student speech, the special interests offered by the school are not sufficient to overcome B.L.’s interest in free expression in this case.”

The court’s decision on Wednesday said “courts must be more skeptical of a school’s efforts to regulate off-campus speech, for doing so may mean the student cannot engage in that kind of speech at all.”

The school in fact “has an interest in protecting a student’s unpopular expression, especially when the expression takes place off campus,” because “America’s public schools are the nurseries of democracy.”

Levy was a high school sophomore in 2017 when she tried out for her school’s varsity cheerleading team but didn’t make the cut. She posted the Snapchat messages over the following weekend, while at a convenience store. The posts were later seen by the school’s cheerleading coaches and the principal, who suspended Levy from the squad for the upcoming year, saying she violated the school’s rules. 

She responded to the court’s ruling with a statement. “The school went too far, and I’m glad that the Supreme Court agrees,” Levy said. “I was frustrated, I was 14 years old, and I expressed my frustration the way teenagers do today. Young people need to have the ability to express themselves without worrying about being punished when they get to school. 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.”