(Reuters) - Big Soda scored a major victory on Thursday as California passed a law that bans local sugar taxes through 2030 in the most populous U.S. state, where cities including Berkeley have approved such levies.

FILE PHOTO: Sodas are displayed at a Walmart store in Secaucus, New Jersey, November 11, 2015. REUTERS/Lucas Jackson

The law, signed by Governor Jerry Brown as a compromise in the face of a soda industry-backed ballot initiative, prevents any local government from imposing future taxes on groceries including carbonated and noncarbonated nonalcoholic beverages through 2030. So-called soda taxes gained traction in the San Francisco area in 2014 and 2016.

The soda industry had supported a ballot initiative that would make it more difficult for any locality to raise taxes. If the measure remains on the ballot, Californians in November could vote to require that any locality’s taxes be passed by a two-thirds vote, rather than simple majority of voters or elected bodies.

Brown, a Democrat, called the ballot initiative an “abomination” in a signing statement and said mayors supported the compromise.

“The soda industry has deep pockets and used them to push the legislature into a no-win situation,” California state Senator Bill Monning said before the vote. The Democrat, who has supported soda taxes as a way to combat chronic health problems such as obesity and diabetes, voted against the bill.

The Democratic-controlled state Senate and Assembly voted in favor of the legislation on Thursday. The Sacramento Bee reported this week that Brown had dinner this month with officials from the American Beverage Association, PepsiCo Inc and Coca-Cola Co.

“This proposal was not discussed at the dinner,” said Lauren Kane, a spokeswoman for the American Beverage Association. She did not respond to a query on what was discussed.

The ABA said the legislation would protect consumers from potential taxes. “We’re working with the public health community and government officials to help Californians reduce sugar consumption in ways that don’t cost jobs or hurt the small businesses that are so important to local communities,” it said in a statement.

The move is part of a worrying national trend, said Eric Crosbie, a post-doctoral scholar at the University of California San Francisco, who is researching such measures. Arizona and Michigan have already enacted similar legislation.

“The beverage industry and their lobbying arm are doing this very similarly to what we saw in the pre-emption of tobacco control,” he said. “Once it’s in the legislation, it’s difficult to reverse.”