When David Leitch came on board to direct “Deadpool 2,” the sequel to the 2016 action comedy featuring Marvel Comics’ foul-mouthed antihero, he started with one thing in mind.

“The goal wasn’t to outdo the [first] movie. The goal was to deliver something worthy of the [first] movie,” Leitch said.

Whatever happens on the screen, “Deadpool 2” will be hard-pressed to top what the first “Deadpool” did to Utah’s liquor laws, in a landmark legal case that involved beer, the First Amendment, a former Salt Lake City mayor, and a unicorn ejaculating rainbows.

This image released by Twentieth Century Fox shows Ryan Reyonlds in a scene from "Deadpool." (Joe Lederer/Twentieth Century Fox Film Corp. via AP)

It started on Feb. 26, 2016, two weeks after “Deadpool” opened in theaters nationwide. That’s when three undercover officers of Utah’s State Bureau of Investigation, acting on a complaint made to the Department of Alcoholic Beverage Control, entered the theater/bar, bought some beers and watched the movie.

The officers reported scenes of simulated sexual behavior — mostly between the lead character, Wade Wilson (Ryan Reynolds), and his girlfriend, Vanessa (Morena Baccarin) — including scenes that implied oral sex. One officer also reported “a drawing of the main character (male) … as he rides on the back of a unicorn, he rubs its horn briefly until the horn shoots out rainbows (simulating orgasm).”

Two months later, the DABC cited Brewvies for violating a section of the Utah Code. The citation could have cost the theater pub a $25,000 fine and possible revocation of its liquor license. This wasn’t a first offense: Brewvies had been cited previously for screening “The Hangover Part II” and given warnings after screening “Magic Mike XXL” and “Ted 2.”

“I thought it was something out of The Onion,” said Del Vance, owner of the Beerhive Pub in downtown Salt Lake City, and a resident historian on Utah liquor laws.

Vance said he suspects that some strip club operator, jealous that they can’t serve booze where there’s nudity, tattled to the state about Brewvies’ screening of “Deadpool.”

“If they hadn’t have said anything, the whole incident wouldn’t have happened,” Vance said. “[The clubs] were looking for a double standard, but it’s a pretty lame double standard.”

Officials from the DABC did not return requests for comment.

The law “should never have been applied to Brewvies in the first place,” said Rocky Anderson, civil-rights lawyer and former Salt Lake City mayor, who represented Brewvies in a lawsuit against the DABC and the state Attorney General’s Office.

The law, section 32B-1-504, was aimed at “attire and conduct” at places serving liquor that “are considered contrary to the public health, peace, safety, welfare, and morals.”

Anderson laughed at that last part. “It’s blatantly legislating morals to an incredibly absurd degree,” he said, adding that “showing a film is not conduct. It’s pure expression.”

The case became a national news story. Brewvies set up an online crowd-funding campaign for its legal defense fund. Reynolds donated $5,000 to the cause, tweeting, “Thank god, they’ve found a way to legislate fun.”

“Freedom of speech lives — thank God,“ Leitch said. “It doesn’t surprise me that Ryan would stand up for that kind of stuff. He is obviously Deadpool incarnate.”

Actors Blake Lively, left, and Ryan Reynolds attend a special screening of "Deadpool 2" at AMC Loews Lincoln Square on Monday, May 14, 2018, in New York. (Photo by Brent N. Clarke/Invision/AP)

On Aug. 31, 2017, U.S. District Judge David Nuffer ruled in Brewvies’ favor on First Amendment grounds.

The state may have compelling interests to avoid “potential negative secondary effects” of combining sexual conduct and alcohol, Nuffer wrote in his ruling, but the state’s enforcement mechanism used against Brewvies was “not the least restrictive means for accomplishing” those goals. Nuffer also noted that Brewvies wasn’t a “sexually oriented” theater, but played mainstream movies similar to those screening at other theaters.

“The state cannot argue that it has plenary power to control liquor licensing under the 21st Amendment [which ended Prohibition], to the point of obliterating First Amendment rights,” Nuffer wrote.

Anderson lamented the state’s efforts to defend a law he believes was blatantly unconstitutional. “They do some of the stupidest things and waste all of our money trying to defend it,” he said.

Brewvies celebrated the ruling with free screenings last September of “Deadpool,” “Magic Mike XXL” and “The Hangover Part II.”

The Attorney General’s Office ultimately decided not to appeal Nuffer’s ruling. Earlier this year, the Utah Legislature passed a bill to amend that part of the Utah Code, to bring the law in accord with the ruling.

Brewvies has thrived since the ruling. This week, the theater announced it would open a second location this summer at 2293 Grant St. in Ogden. This weekend, of course, the original Brewvies will play “Deadpool 2,” which is as profane as the original — though with less of the sexual imagery.

For the franchise, Leitch said, the sky’s the limit.