For more than a decade, Coca-Cola, Pepsi and other beverage companies have fought mightily against efforts to tax sugary sodas, defeating more than three dozen such proposals around the country.

But this month, voters in San Francisco, Oakland and Albany, California, as well as Boulder, Colorado, stunned the industry by approving ballot measures in favor of soda taxes. Cook County, Illinois, followed a few days later, bringing a soft-drink tax to Chicago and surrounding areas. They are joining Berkeley, California, which passed a tax two years ago, and Philadelphia, which passed one in June, bringing to seven the number of U.S. communities with soda taxes.

With that public momentum, a soda tax may be coming to a city near you.

Advocates say the recent sweep represents a watershed moment in the fight for soft-drink taxes. Once viewed as measures likely to find support only in largely health-conscious cities like Berkeley and Boulder, soda taxes have emerged as a bountiful revenue source for cash-strapped local governments to fund early childhood education, public safety and deficit reduction. Soda tax advocates say they believe more cities will now consider their own taxes on sweetened beverages to combat obesity and to finance local programs.

“There’s a momentum with these taxes that will be hard for the industry to stop,” said Kelly D. Brownell, dean of the Sanford School of Public Policy at Duke University, who met with some ridicule when he first proposed a “sin tax” on junk food in 1994. “I expect a year or two from now that the taxes will be widespread.”

All of the new measures so far impose a tax of at least a penny per ounce of sugary drinks, including sodas, sweetened iced teas and some fruit drinks. Soda tax supporters say they are taking inspiration from the fight against tobacco, which included successful efforts to impose hefty taxes on cigarettes as a way to curb consumption. They have even taken to calling the industry “Big Soda,” a not-so-veiled reference to Big Tobacco.

Soft-drink sales were already slumping — more and more consumers have switched to bottled water and other drinks they consider healthier options than carbonated soft drinks. Viewing taxes as another threat to its core products, the beverage industry has fought vigorously, organizing local business coalitions, lobbying politicians, and spending millions of dollars on advertising and direct mail. The American Beverage Association, an industry trade group, spent $38 million opposing the fall ballot proposals, though it lost every one.

Even so, beverage makers say they are not convinced that soda taxes will be widely adopted. With the help of the beverage association, they have effectively painted the taxes as unfair nanny-state measures that are bad for business and impose a disproportionate burden on the poor.

“I’m originally from Iowa, born and bred, and I just don’t see this discriminatory, regressive tax being embraced by Iowans or Midwesterners or Southerners and others in a large swath of the country,” said Susan Neely, president of the American Beverage Association. “I just do not believe that this is going to be a tax sweep throughout America. “

But public opinion on soda has turned more negative in recent years, with a growing share of Americans believing that sugary drinks contribute to obesity, Type 2 diabetes and other maladies.

And the industry now faces a more sophisticated and well-financed opposition. Soda taxes, once a fanciful cause of amateur health crusaders and academics like Brownell, have drawn the support of politically active billionaires. Michael R. Bloomberg, the former New York City mayor, poured nearly $20 million into the Bay Area soda tax campaigns, hiring political consultants and media experts with extensive experience lobbying city councils and shifting public opinion.

In 2012, when the mayor proposed a limit of 16 fluid ounces on sugary drinks sold in New York, he was pilloried by opponents and ridiculed by late-night comedians as a fun-hating scold. The measure was rejected in court. Four years later, Bloomberg said, he is still met at speaking engagements with Big Gulp cups, a gibe at his failed soda regulation effort.

But now he sees soft-drink regulation gaining mainstream acceptance.

“While we may have lost that battle in the courts, you can make the very good case that we won the war,” Bloomberg said.

The industry remains adamant that it will continue fighting soda taxes. The beverage association argues that sugary drink consumption has not increased obesity, and that soda taxes will not reduce it. But the trade group also claims it is doing its part to reduce obesity by encouraging consumers to drink its diet and low-calorie options instead of full-calorie sodas. Neely, the beverage association president, has been trumpeting industry efforts to market lower-calorie choices as proof of a commitment to public health.

“One thing we’ll continue to do with full gusto is try to reduce calories and sugar in the American diet,” Neely said. “We don’t want to fight with public health. We agree that more needs to be done, and we’re trying to do it in a very serious and systematic way. We believe we have a responsibility to help address the obesity problem, and we’re doing it in a way that we think is powerful and will yield lasting results.”

Research from Mexico, which approved national taxes on sugary drinks and junk food in 2013, has found that taxes did drive down soft-drink sales, particularly among low-income populations that tend to drink the most of those. Research on Berkeley’s soda tax found a similar trend. But it is too soon to know whether those drops in sales will lead to lower rates of obesity or diabetes.

Still, not every politician has needed a public health argument to embrace a soda tax. Jim Kenney, the mayor of Philadelphia, sold a tax there to City Council members by linking it to a popular initiative to expand prekindergarten. Cook County officials described the tax revenue as crucial to closing budget shortfalls so they could save public safety jobs. And Santa Fe, New Mexico, the latest city to propose a soda tax, presented it as a way to raise much-needed money for early childhood education.

John Arnold, a hedge fund billionaire who invested heavily in the Philadelphia and California campaigns, said he became interested in soda taxes for public health reasons, but also believes soda taxes have advantages over other ways to raise municipal money. “Do you do it by increasing sales taxes or increasing income taxes, or can you find ways, like through soda taxes, where you get an added benefit of improving the health at the local level in addition to raising money?” he asked.

Both Arnold and Bloomberg said they hoped the recent election successes would make soda taxes a more popular idea, able to attract political support and a wider array of financial supporters. Bloomberg said he was committed to funding well-organized efforts as they continue to emerge.