Philadelphia City Council voted in favor of a 1.5-cent per ounce tax on regular and diet sodas after 8 p.m. on Wednesday, after a terse hours-long hearing that saw numerous delays.

City Council passing the measure marks a major victory for Mayor Jim Kenney on his first major legislative push since taking office in January.

The vote came after months of aggressive lobbying and advertising against the tax funded by major soda manufacturers.

"This has been a rather difficult process for a number of us," Council President Darrell Clarke said before the vote. "We hope that the outcome is one that will obviously benefit pretty much every citizen in the city of Philadelphia."

"The action that we will take will probably have some people with a sour taste in their mouth, but we believe working with those individuals on a long-term basis, we will ensure this will be a fair and equitable solution," Clarke said.

The amended soda tax bill passed favorably out of the Committee of the Whole on Wednesday night. It still has to be voted on during a full session, but enough council members support the amended bill to guarantee it will pass.

Various groups for and against the tax sprang up overnight, with opponents labeling the proposed tax on soda and other sugary drinks "regressive" and calling it a "grocery tax," while supporters' tactics included invading the offices of unsupportive councilmembers.

The soda industry reportedly poured millions into their campaigns, which included widespread TV and online advertising, while supporters of the tax, including former New York Mayor Michael Bloomberg, spent millions as well to push the benefits of the tax.

More than 50 locals got their turn to make their voices heard during a contentious hearing on Wednesday afternoon, delivering testimony on the benefits and drawbacks of both the soda tax, and Councilwoman Blondell Reynolds Brown's proposed alternative container tax. The hearing followed another contentious hours-long hearing on May 4.

Many focused on the funds a soda tax would bring to Kenney's proposal of universal pre-k programs for the city's children.

"If 90 percent of the brain is developing between 3 and 5 years of age, while I'm sitting here, somebody is turning 5 years old, and we may have missed the critical period," Philadelphia NAACP chapter president Rodney Muhammad testified at the hearing. "If we don't do something now, then we pay the misery tax later -- endless programs trying to repair lives, the cost and burden for public safety on the city's budget, long prison sentences, the list just goes on and on."

Kenney had touted the 3-cent proposal as bringing in more than $400 million for schools -- with $256 million funding pre-K, $56 million for Kenney's $300 million plan for rehabilitating parks, rec centers and libraries; $26 million for city pensions, $23 million for a green jobs plan, and $39 million toward community schools.

But instead the mayor's push yielded a compromise -- City Council voting to pass a slightly lower tax on sugary drinks, 1.5 cents per ounce on sugary drinks, as well as and diet sodas.

However, even City Council's vote does not guarantee the tax will take effect. The American Beverage Association may be planning a legal challenge to the tax by arguing it is a "sales tax," City and State PA reported. Such taxes can only be passed by state officials.

Republican City Councilman David Oh argued at the hearing that a re-balanced city budget could provide the same projected tax revenues

Oh said his staff found in the city’s 2017 budget $180 million in "disguised over-allocations," in large and unneeded sums of money that are traditionally "parked" in the budgets for various city department, and then tapped by the city in various ways over the course of the year.

"If you want our city to move forward with universal pre-K ($26 million), community schools ($4.2 million), improvements in parks and recreation facilities, and rebuilt community infrastructure ($12.5 million), your wish can come true. Don’t believe that you need to pay extra for it," Oh wrote in a letter explaining the argument. "Let’s get the city’s budgeting in order before we resort to increasing taxes."

Berkeley, California is so far the only other city that has soda tax of one cent per ounce that went into effect in 2015.

Bloomberg failed to get a soda tax passed in New York City 2010, and in 2013, a ban he instituted on soda being served in larger than 16-ounce servings was blocked by a state judge.