The US Supreme Court, on Wednesday, ruled in favour of a Pennsylvania teen who sued her school after her profane off-campus cost her a spot in the school’s cheerleading team. This was a closely-watched free speech case.

In a narrow decision, the justices, in an 8-1 ruling, ruled that Mahanoy Area School District officials’ punishment given to Brandi Levy for her social media post violated her free speech rights. The post was made that was made at a local convenience store in Mahanoy City, Reuters reported.

“It might be tempting to dismiss B. L.’s words as unworthy of the robust First Amendment protections discussed herein,” Justice Stephen G. Breyer wrote in his 11-page majority opinion.

“But sometimes it is necessary to protect the superfluous in order to preserve the necessary.”

Brandi, now an 18-year-old college student, in her freshman year, posted on Snapchat a photo of herself with this rant: “F— school, f— softball, f— cheer, f— everything.” It was sent to about 250 friends, including fellow cheerleaders at her school.

Soon after Brandi was suspended from cheerleading for a year after coaches were alerted about it.

In a statement Wednesday, Washington Post quoted Brandi as saying: “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.”

However, the justices said that schools do not have authority over student speech off-campus but did not endorse it.

“We do not now set forth a broad, highly general First Amendment rule stating just what counts as ‘off campus’ speech and whether or how ordinary First Amendment standards must give way off campus to a school’s special need to prevent … substantial disruption of learning-related activities or the protection of those who make up a school community,” Breyer wrote.

But Levy’s speech did not fit, he wrote.

“The vulgarity in B. L.’s posts encompassed a message, an expression of B. L.’s irritation with, and criticism of, the school and cheerleading communities,” Breyer wrote, adding “the school’s interest in teaching good manners is not sufficient, in this case, to overcome B. L.’s interest in free expression.”

Justice Clarence Thomas was the lone dissenter.

David Cole, the ACLU’s legal director, called the outcome “a huge victory for the free speech rights”