Andrew Scrivani for The New York Times

It is no longer illegal for a California bartender to put a basil leaf in a bottle of gin.

On Wednesday, Gov. Jerry Brown of California announced that he had signed Senate Bill 32, which overturns a legal vestige of Prohibition that made it unlawful to infuse alcohol with fruits, vegetables, herbs or spices. Such infusions have been popular in the country’s best cocktail bars for several years, and the old rule became a nuisance early last year when State Department of Alcoholic Beverage Control agents started warning bars like San Francisco’s Bourbon & Branch that they were breaking California law with their house-made tinctures and bitters.

To bartenders, the sudden enforcement of the obscure rule was alarming. Taking infusions away from innovative mixologists was akin to rescinding a hot dog stand’s right to use mustard.

The bill was introduced by State Senator Mark Leno, Democrat of San Francisco, late last year. After it was approved by the legislature, the San Francisco bartenders Josh Harris and Scott Baird started an online petition to pressure Mr. Brown to sign the legislation. On Wednesday, he did.

“In San Francisco and other cities where tourism is critical to the local economy, restaurant owners have been asked to stop serving infused cocktails in the name of an outdated law written decades ago,” said Mr. Leno in a statement. “This Prohibition-era statute did nothing more than punish California restaurants and small businesses that are using culinary innovations to survive in this difficult economy.”

“More than anything else, it’s similar to developments around the country where cocktail culture has outpaced the legacy of Prohibition laws that exist,” observed Frank Coleman, senior vice president of The Distilled Spirits Council of the U.S., a trade organization representing distillers that spends a lot of its time trying to strike down obsolete, antiliquor laws.

The bill contains an “urgency clause,” which means bars can start slinging their infused concoctions immediately.