A new push by the beverage industry is slowing the expansion of soda taxes in California and elsewhere.

California cities pioneered soda taxes as a way to combat obesity, diabetes and heart disease, but the Legislature and Gov. Jerry Brown on Thursday bowed to pressure from beverage companies and reluctantly banned local taxes on soda for the next 12 years.

It follows similar bans recently passed in Arizona and Michigan. Voters in Oregon will decide on a statewide ban in November. The American Beverage Association, which represents Coca-Cola, PepsiCo and others, has backed the moves after several cities passed taxes on sugary drinks in recent years.

“I’ve been in politics a long time, and sometimes you have to do what’s necessary to avoid catastrophe.”

California’s ban is part of a last-minute maneuver to block a beverage industry-backed ballot measure that would make it much harder for cities and counties to raise taxes of any kind. The ABA said in a statement the legislation is about keeping groceries, including drinks, affordable.

Lawmakers approved the proposal despite deep reluctance.

“This industry is aiming a nuclear weapon at government in California and saying, ‘If you don’t do what we want we are going to pull the trigger and you are not going to be able to fund basic government services,’” said Sen. Scott Wiener, a Democrat from San Francisco, which has a soda tax.

Assemblyman Matthew Harper, R-Huntington Beach, sips a Coke as Assembly members debate a ban on local soda taxes, June 28, 2018, in Sacramento, California. Rich Pedroncelli / AP

The Legislature’s action drew a strong rebuke from public health advocates who view soda taxes as a crucial front in their efforts to contain obesity and the health complications it causes.

But local government officials, terrified by the prospect of having their hands tied on all future tax increases, reluctantly backed the legislation.

“I’ve been in politics a long time, and sometimes you have to do what’s necessary to avoid catastrophe,” said Sacramento Mayor Darrell Steinberg, who is pushing a local sales tax increase that would be at risk if the ballot measure passed.

The governor said only a handful of communities are looking to tax soda, but the ballot measure would affect all 482 cities in California.

“Mayors from countless cities have called to voice their alarm and to strongly support the compromise which this bill represents,” Brown wrote in a memo explaining his decision.

The California measure bans any new taxes on groceries including beverages through 2030, but allows four cities in the San Francisco Bay Area to keep soda levies already on the books.

The beverage industry has used aggressive campaigning to beat back soda taxes and other measures. But some soda tax efforts are now receiving better funding. Former New York City Michael Bloomberg, a billionaire who unsuccessfully tried to limit the size of sugary drinks sold in the city to 16 ounces, has funded some local efforts.

Philadelphia, Seattle and Boulder, Colorado also have taxes on sugary drinks.

After Brown signed the legislation, the California Business Roundtable withdrew a ballot measure that would have raised the threshold for any tax increases by local government.

Nancy Brown, chief executive of the American Heart Association, asked for a meeting with Gov. Jerry Brown after The Sacramento Bee reported beverage industry lobbyists dined with Brown and his wife Anne Gust Brown at the governor’s mansion in Sacramento this month.

A spokesman for Brown, Evan Westrup, said the governor did not negotiate the deal and the dinner was unrelated.

Public health officials said taxes are the most effective tool they have to discourage people from drinking soda, sports drinks, sweetened coffee and tea, and other sugary beverages.

Beverage companies spend billions promoting their products that public health professional can’t match, said Kristine Madsen, a physician and associate professor of public health at University of California, Berkeley.

She led a study that found a 20 percent reduction in consumption of sugar-sweetened beverages in low-income neighborhoods in the year after the city’s tax took effect. Sales in grocery stores dropped 8 percent — a figure that was not fully offset by higher sales in neighboring towns.