A U.S. judge on Thursday struck down a Utah law that landed a movie theatre in trouble for serving alcohol during the racy superhero film Deadpool.

U.S. District Judge David Nuffer said state regulators violated Brewvies' freedom of speech when it threatened to fine the theatre up to $25,000 US under a law that prohibits serving booze during films with simulated sex or full-frontal nudity.

Attorney Rocky Anderson calls the decision enormously important for First Amendment rights. He argues the law is so vague it would apply to an art gallery offering wine near Michelangelo's David and that the state used it to intimidate the theatre.

"This is a huge victory for everyone," he said.

Lawmakers and the governor have supported the law in the conservative state where politics are dominated by Mormons whose faith teaches avoidance of alcohol.

The case caught the attention of Deadpool star Ryan Reynolds, who donated $5,000 US to help pay the theatre's legal bills last year.

Alcohol, sexual content an 'explosive combination:' state attorneys

The state is reviewing the ruling and considering its options, said Dan Burton, a spokesman for the Utah Attorney General's Office.

State attorneys call alcohol and sexual content an "explosive combination." The 2016 complaint against the theatre came under a law generally used to ensure strip clubs that serve liquor keep dancers wearing G-strings and pasties. But it also bans serving booze during films featuring nudity or sex scenes.

Utah argued that Deadpool violated the law because the movie includes nudity and simulated sex, including a suggestive scene in the film's credits involving a cartoon unicorn.

The judge disagreed.

Hey <a href="https://twitter.com/VancityReynolds">@VancityReynolds</a> - we won! Ut ❤s you! <a href="https://t.co/gWPaNNK2tI">https://t.co/gWPaNNK2tI</a> —@hepcatblm

"Brewvies is not an adult oriented establishment," Nuffer wrote.

"Brewvies does not focus on sex. It shows the same movies that other, non-sexually oriented movie theatres show but with alcohol."

Utah's law is similar to an Idaho measure that lawmakers repealed last year when a theatre sued after its liquor licence was threatened for showing Fifty Shades of Grey while serving alcohol.