WASHINGTON — A streetwear brand whose name sounds like a form of the F-word can get federal trademark protection as a result of a Supreme Court ruling on Monday.

The court struck down a century-old provision of federal law that bans registration of proposed trademarks that are "scandalous" or "immoral." Applying that rule, the government denied a trademark for the name "FUCT," concluding that it was phonetically equivalent to the past tense or past participle of the well-known vulgarity.

"The clothing line," explained Justice Elena Kagan for the court's 6-3 majority, "is pronounced as four letters, one after the other: F-U-C-T. But you might read it differently and, if so, you would hardly be alone."

Nonetheless, she said, the trademark law's restriction violates the First Amendment because "it disfavors certain ideas."

She was joined by the court's senior liberal, Ruth Bader Ginsburg, and four of the court's conservatives, Justices Clarence Thomas, Samuel Alito, Neil Gorsuch and Brett Kavanaugh.

The trademark office considered a name to be scandalous if it was "shocking to the sense of truth, decency, or propriety" or "disgraceful, offensive, disreputable." Lower federal courts said the prohibition also applied to terms that were "vulgar, lacking in taste, indelicate, and morally crude."

Kagan said the restriction "permits registration of marks that champion society's sense of rectitude and morality, but not marks that denigrate those concepts."

A key problem with the law, she said, is its reach, because it "does not draw the line at lewd, sexually explicit, or profane marks," but instead "covers the universe of immoral or scandalous," which sweeps in viewpoint.

Dissenting, Chief Justice John Roberts said that while the First Amendment protects freedom of speech, "it does not require the government to give aid and comfort to those using obscene, vulgar, and profane modes of expression."

The decision was a victory for Erik Brunetti, who launched a line of streetwear in 1990 along with skateboarding legend Natas Kaupas. Looking for a brand name that would match the subversive, anti-establishment theme of their clothing, they coined the four-letter word to appear on their T-shirts, hoodies, jackets and shorts.

When the trademark office turned Brunetti down, he fought back. A federal appeals court agreed that the brand name was scandalous, but it ruled that the provision of law barring trademarks for such terms violated freedom of speech.

The Supreme Court agreed in Monday's decision. As a result, the government cannot suppress expression merely because it will be off-putting to others. Two years ago the justices struck down another provision of federal law barring trademarks that disparage people or "bring them into contempt or disrepute."

That earlier ruling was a victory for the Asian American leader of a Portland, Oregon, dance-rock band who wanted to call his group "The Slants." Speech that demeans is hateful, but the First Amendment protects even thoughts that we hate, the court said in 2017. The ruling was also hailed by the NFL's Washington Redskins, whose application for a trademark had been rejected on the grounds that it was demeaning to Native Americans.

The Trump administration had urged the court to uphold the decision of the trademark office in Brunetti's case and keep the provision banning protection for scandalous terms. The government said his speech wasn't being restricted because he could call his clothing line whatever he wanted and has used the term since 1991. He just couldn't get the benefit of a federal trademark.

Brunetti had said in interviews that the brand name could be understood to be an acronym for "Friends U Can Trust." But when his lawyer suggested during the courtroom argument that the name wasn't truly a vulgarity, Justice Samuel Alito said: "Oh, come on. Be serious. We know what he's trying to say."

As a result of Monday's ruling, Brunetti can now get federal trademark protection to say it.