WASHINGTON — A bare majority of the U.S. Supreme Court seemed prepared Monday to allow a trademark for a California clothing brand that uses a form of the f-word. But the justices didn't appear very happy about the prospect.

Eric Brunetti chose a brand name to match the subversive, anti-establishment theme of his line of streetwear. The single four-letter word "Fuct" appears on his brand of T-shirts, hoodies, jackets and shorts.

But the federal government refused to issue him a trademark, citing a provision of law requiring the Patent and Trademark Office to refuse registration of proposed trademarks that are "scandalous" or "immoral."

Government attorneys concluded that Brunetti's brand name was phonetically equivalent to the past tense of what a Justice Department lawyer called "the paradigmatic profane word in our culture."

The trademark office considers a name to be scandalous if it is "shocking to the sense of truth, decency, or propriety" or "disgraceful, offensive, disreputable." Federal courts have said the prohibition also applies to terms that are "vulgar, lacking in taste, indelicate, and morally crude."

For that reason, several of the justices said during Monday's courtroom argument that the law amounts to a restriction on viewpoint, which isn't allowed under the First Amendment. Two years ago, the court struck down a parallel provision of federal law barring trademarks that disparage people or "bring them into contempt or disrepute."

As a result of that earlier decision, Justice Department lawyer Malcolm Stewart told the justices that the government would now likely narrow its application so that only terms that are obscene or shocking would be barred.

"How is it determined?" asked Justice Ruth Bader Ginsburg, "that a word is shocking? Is it a substantial part of the public? Would a composite of 20-year-olds find it shocking?"

Justice Elena Kagan said the law sweeps more broadly. "If Congress wants to pass a narrow statute, it can do that," she said. "You're asking us to uphold the statute based on a commitment to apply it more narrowly. That's a strange thing for us to do."

Stewart also said the law does not restrict speech, because Brunetti can call his clothing whatever he wants. He just can't get a trademark. "The law isn't a limitation on speech," Stewart said. "It's a limitation on a government benefit."

"You keep telling us this is a government benefit," Justice Sonia Sotomayor said. "But people pay for this and get certain legal rights."

Several members of the court were also concerned that the trademark office operates without a clear standard. Justice Brett Kavanaugh said the result is that the law is enforced inconsistently.

Justice Neil Gorsuch sounded a similar concern. "I can't see the rational line. Is it a flip of a coin?"

John Sommer, an Irvine, California, lawyer representing Brunetti, said in his written briefs that the government has issued a trademark for the brand name "FCUK," which that company insists stands for French Connection UK, a clothing line called "Fword," and an online dating site known as "WTF is up with my love life?!"

But Sommer didn't have much luck trying to persuade the court that the term Brunetti wants to trademark isn't a form of a notoriously dirty word.

"Aw, c'mon, be serious," Justice Samuel Alito said. "We know what he's trying to say."