The former mayor of New York City may be responsible for the nation’s first soda tax.

The measure, passed in Berkeley, Calif., on Tuesday, adds a one-cent tax to each ounce of sugar-sweetened drinks. It was supported by 75 percent of voters.

In 2012, Bloomberg banned the sale of sodas larger than 16 ounces in New York, an effort to curb obesity by limiting empty sugar calories. However, the ban was thrown out after beverage companies sued. Bloomberg appealed the decision to the state’s highest court and lost.

Undeterred and no longer in office, Bloomberg joined the anti-sugar crusade in California.

Instead of banning big drinks, Berkeley’s Measure D makes soda, sports drinks and other sugary beverages more expensive. The idea is to deter people from drinking soda, the primary source of added sugar in the American diet. The measure is expected to raise more than $1 million per year — revenue that will be put towards health programs.

Supporters of the measure included the NAACP, American Heart Association and American Academy of Pediatrics.

Bloomberg was the biggest donor to support the measure, committing $657,000 to the campaign as of Nov. 3, according to the local news site Berkeleyside. His cash was used to bankroll ads in favor of the tax that ran during local broadcasts of the World Series.

Not surprisingly, the political arm of the American Beverage Association, which counts giants like Coke and Pepsi among its contributors, bankrolled the opposition. The vast majority of the $2.4 million — $30 per registered voter — spent to defeat the Measure D came from soda companies. However, Regal Entertainment and the company that owns Landmark Theaters kicked in some cash too.

The fierce debate over the sugar tax helped make the 2014 midterms the most expensive election ever held in Berkeley.

Across the bay in San Francisco, a similar tax failed. San Francisco’s Proposition E would have taxed sugary drinks at two cents per ounce, twice as much as the Berkeley law. It required approval by two-thirds of voters, while Berkeley’s only required a simply majority. Bloomberg didn’t donate to that campaign, according to Berkeleyside.

According to the Wall Street Journal, beverage makers spent more than $100 million to defeat more than 20 soda-tax proposals across the country in the past five years. South of the border, they have been less successful — soda consumption dropped by 5 percent in Mexico after a soda tax was introduced in January.

Howard Wolfson, one of Bloomberg’s senior advisers, called the Berkeley win a “big victory for public health” in a conference call with reporters. He suggested Bloomberg’s anti-sugar crusade will continue. “We stand ready to assess and assist other local efforts in the coming election cycle,” Wolfson said.