SAN FRANCISCO (AP/CBS13) — 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.

READ MORE: Cold War-Era Relic Responsible For Loud Siren In East Sacramento Monday Night

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.”

READ ALSO: Lawsuit Aims To End California License Plate Language Limits

According to the judge’s ruling, others were refused because their plate may sound or look like a swear word or could be construed as sexual.

READ MORE: Caltrans May Change Speed Limits On Highway 99 To Limit Congestion

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.” 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.

Tigar did say the DMV could probably 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.”

MORE NEWS: Bicyclist Killed In Hit-And-Run Collision In Fairfield

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