Mayor Kenney might have persuaded City Council to support a tax on sweetened beverages. But in the end what could matter most is if his lawyers can persuade the courts.

Minutes after Council passed the unprecedented per-ounce levy Thursday, the beverage industry vowed to continue a fight it has already poured more than $5 million into by filing suit.

Kenney wasn't rattled. "We're ready," he said.

But a particularly qualified voice says Kenney shouldn't be so confident. Former state Supreme Court Chief Justice Ronald Castille has called the tax unconstitutional.

"In my opinion, the proposed tax by the ounce is a thinly disguised sales tax," Castille wrote in a commentary in the Inquirer last week. "And the city knows as much."

The tax, which will fund among other things an expansion of early childhood education, will add 1.5 cents per ounce to the cost of most sugary and diet beverages. Public policy and health advocates have been quick to call it a watershed move, saying other cities are sure to follow suit.

But that enthusiasm will wane if the tax doesn't stick under legal scrutiny. Because of the high stakes, legal and political experts expect whichever side loses in the first round to appeal, potentially all the way to the state Supreme Court.

In considering whether Philadelphia's tax will withstand constitutional muster, there's little existing precedent. Few cities have imposed restrictions on the sales of sugary drinks, and even fewer of those cases have been challenged in court.

The beverage industry did not file suit after voters in Berkeley, Calif. in 2014 passed a 1-cent-per-ounce tax on soda.

It did - and won - after New York City's Board of Health in 2012 banned the sale of large fountain sodas. But the decision from New York state's court of appeals probably will have no impact in Philadelphia. The court ruled the board of health had overstepped its bounds and the ban, to be legal, should have been imposed by City Council.

Shanin Specter, whose Center City law firm Kline & Specter was retained by the American Beverage Association after Thursday's vote, declined to discuss the strategy in detail but said they plan to challenge on two fronts:

One, that it is a de facto sales tax and preempted by the state. And two, that it violates a law requiring similar items to be taxed at the same rate.

"In the past century there have been several local governments that have tried to impose similar unlawful taxes - such as on coal, liquor and billboards - and they've been properly struck down by the courts," Specter said in a statement.

On the first point, both sides agree the city cannot impose a sales tax where the state already does.

They disagree, though, on whether the soda tax is a sales tax.

The beverage industry argues it is because the tax, though paid by distributors, will be paid in part by consumers. City Solicitor Sozi Tulante argues the legislation doesn't require that pass through - and that's what matters.

"You have to look at what the legislation requires people to do," Tulante said. "That's a business decision."

The second point centers around the state's uniformity clause, which requires similar products to be taxed at the same rate.

Castille, in his commentary, said the tax isn't uniform because it won't be levied on beverage distributors in other parts of the state.

Tulante said the argument surprised him because he had never heard it before. He said the uniformity clause stipulates that the tax has to be equal "within the territorial limits" of the taxing authority.

Within the city, Tulante said, Philadelphia decided to treat diet and sugary beverages different than all other beverages. He called it a "pretty reasonable and rationale" line to draw.

It's unclear when the beverage industry will file suit, or how long it will take to wind its way through the courts. The lawsuit over New York's big soda ban took two years to run its course.

In the meantime, Philadelphia plans to start collecting the tax Jan. 1 unless a judge grants an injunction. Tulante said he finds that unlikely because the judge would take into account the likelihood of the city winning the case. On that point, Tulante is confident.

"We are prepared for a lawsuit," he said. "We know this stuff cold."