California can't enforce a ban vanity license plates it considers “offensive to good taste and decency” because that violates freedom of speech, a federal judge ruled Tuesday.

U.S. District Judge Jon Tigar ruled in a case filed in March against Department of Motor Vehicles Director Steve Gordon on behalf of five Californians who were denied permission to put their messages on personalized license plates.

They included a gay man in Oakland who owns Queer Folks Records and wanted to use the word “QUEER" but was refused because the DMV said that might be considered insulting; a fan of the rock band Slayer who was notified that “SLAAYRR” would be considered “threatening, aggressive or hostile” and an Army veteran who wanted to note his nickname and love of wolves with “OGWOOLF” but was refused because the DMV said the OG might be construed as a reference to “original gangster."

LOS ANGELES MAYOR TELLS RESIDENTS TO CANCEL NON-ESSENTIAL TRAVEL AHEAD OF THANKSGIVING

An SUV with a personalized license plate is seen in Beverly Hills, Calif on May 24, 2010. (AP Photo/Damian Dovarganes, File)

An SUV with a personalized license plate is seen in Beverly Hills, Calif on May 24, 2010. (AP Photo/Damian Dovarganes, File)

Others were refused because their plates might look or sound like a swear word or might be construed as sexual, according to the judge’s ruling.

Citing U.S. Supreme Court free-speech cases, the judge struck down a DMV standard that said vanity license plate configurations can't carry “connotations offensive to good taste and decency.”

The judge said the personalized messages were types of personal expression, not “government speech,” and therefore regulations governing them “must be both viewpoint-neutral and reasonable."

SCOTT PETERSON AMONG CALIFORNIA INMATES WHO RECEIVED COVID RELIEF FUNDS, PROSECUTORS SAY

He noted a 2017 U.S. Supreme Court case allowing an Asian American rock band to call itself The Slants in saying that public speech can't be barred because it may offend some people.

However, Tigar said the DMV probably could be permitted to deny plates that are, for instance, obscene, profane or contain hate speech because they fall outside of First Amendment protections.

“This is a great day for our clients and the 250,000 Californians that seek to express their messages on personalized license plates each year,” attorney Wen Fa of the Pacific Legal Foundation, which filed the lawsuit, said in a statement. “Vague bans on offensive speech allow bureaucrats to inject their subjective preferences and undermine the rule of law.”

CLICK HERE TO GET THE FOX NEWS APP

The DMV was reviewing the ruling and declined further comment, the San Francisco Chronicle reported.