The Supreme Court ruled Monday that a federal trademark law banning offensive names is unconstitutional, siding with a rock band whose name had been deemed racially disparaging by the U.S. Patent and Trademark Office.

In an 8-0 ruling, the court determined the law’s so-called “disparagement clause” violates the free speech clause of the First Amendment.

The case centered on Oregon-based, Asian-American band The Slants, which was denied a trademark because its name was considered offensive. The band countered that the 70-year-old law at issue violates free-speech rights -- and Justice Samuel Alito, in the court’s opinion, agreed.

“The commercial market is well stocked with merchandise that disparages prominent figures and groups, and the line between commercial and non-commercial speech is not always clear, as this case illustrates. If affixing the commercial label permits the suppression of any speech that may lead to political or social ‘volatility,’ free speech would be endangered,” he wrote.

The victory for the band could have broader implications and be welcome news for the Washington Redskins, embroiled in its own legal fight over the team’s name. The trademark office canceled the football team’s lucrative trademarks in 2014 after finding the word “Redskins” is disparaging to Native Americans.

At issue in The Slants’ case was a law that prohibits registration of trademarks that “may disparage ... persons, living or dead, institutions, beliefs or national symbols.”

A trademark confers certain legal benefits, including the power to sue competitors that infringe upon the trademark.

Slants founder Simon Tam said his goal was to reclaim a derisive slur and transform it into a badge of ethnic pride. But the trademark office said a term can be disparaging even when used in a positive light. A federal appeals court had sided with the band, ruling that the law violates the First Amendment.

Alito cautioned in his opinion that the government still “has an interest in preventing speech expressing ideas that offend.”

But he suggested the clause in question was too sweeping: “The clause reaches any trademark that disparages any person, group, or institution. It applies to trademarks like the following: ‘Down with racists,’ ‘Down with sexists,’ ‘Down with homophobes.’ It is not an anti-discrimination clause; it is a happy-talk clause. In this way, it goes much further than is necessary to serve the interest asserted.”

Lee Rowland, an attorney with the American Civil Liberties Union which had supported the band, called the ruling a “major victory for the First Amendment.”

Fox News’ Bill Mears and The Associated Press contributed to this report.