The Supreme Court ruled Wednesday that a Pennsylvania public school wrongly suspended a cheerleader over a vulgar social media post.

The court voted 8-1 in favor of Brandi Levy, who was a 14-year-old high school freshman when she expressed her disappointment over not making the varsity cheerleading team on Snapchat with a string of curse words and a raised middle finger.

Levy was not in school when she made her post, but she was suspended from cheerleading activities for a year anyway. In an opinion by Justice Stephen Breyer, the high court ruled that the suspension violated Levy's First Amendment rights.

FILE - This June 8, 2021 photo shows the Supreme Court in Washington. (AP PhotoJ. Scott Applewhite, File)

FILE - This June 8, 2021 photo shows the Supreme Court in Washington. (AP PhotoJ. Scott Applewhite, File)

But the justices did not foreclose schools from disciplining students for what they say off campus.