HARRISBURG — Is Philadelphia's tax on soda and other sweetened beverages a sneaky attempt to evade state law? Or is it a levy that the city has the authority to impose so that it can care for its residents?

Those were among the questions raised Tuesday morning as the Pennsylvania Supreme Court heard oral arguments over the city's controversial tax.

Pennsylvania's highest court must now determine whether the 1.5-cent-per-ounce levy on the distribution of sweetened beverages amounts to double taxation.

A state law known as the Sterling Act allows Philadelphia to impose taxes on items not already taxed by the state. The beverage tax is levied on distributors, but its opponents argue that it has been passed on to consumers, who already pay the state sales tax.

"The argument is that Philadelphia did this artfully to get around the Sterling Act," Justice Max Baer said. "The question is: Did they succeed?"

Other cities and interest groups across the country will pay close attention to the outcome, as Philadelphia was the first major U.S. city to pass a tax on sweetened beverages, and the American Beverage Association and other groups have poured millions of dollars into fighting it.

The tax "unlawfully duplicates the state sales tax," said Marc Sonnenfeld, a lawyer representing a group of local businesses, consumers, and trade associations.

Mark Aronchick, a lawyer representing the city, argued that the tax follows the purpose of the Sterling Act as it was intended when passed in 1932.

"It was put into place so Philadelphia could save itself and so it could take care of itself and its own tax base," Aronchick told the justices.

Six justices spent about an hour listening to arguments from both sides and asking questions. Justice Kevin M. Dougherty, a former Philadelphia judge, recused himself from the case. The court did not provide a reason for his recusal.

Justice David N. Wecht said that if the law is upheld, it could open the door to levying taxes on the distribution of any or all products in the city.

"The line is going to be politics," Aronchick answered. "Politicians don't get up every morning saying, 'Hey, what can I tax?'"

Some questions focused on a phrase in the law indicating that the tax is imposed on beverages distributed "for the purpose of retail sale in Philadelphia." Justices asked whether that indication would mean the tax duplicates the sales tax.

Aronchick argued that the tax is levied at the point of transport and distribution of beverages, and that the retail sale does not trigger the tax. For example, he said, some beverages are distributed but never sold by retailers.

Shanin Specter, a lawyer representing the group that opposes the tax, said in an email after the hearing that he found that line of questioning to be noteworthy.

"That's exactly our argument about why the tax should be voided," he said.

City officials have said some spending for programs the tax is funding — pre-K, community schools, and an initiative to improve parks, libraries, and recreation centers — has been delayed while the litigation works its way through the court system.

"The tax is a major accomplishment for this administration," Aronchick told reporters after the hearing. "They've taken care of all sorts of needs that Philadelphia has, for pre-K programs, rebuilding infrastructure. A lot of the point that I made was the importance of Philadelphia being able to take care of its own problems with its own tax base."

The tax has withstood legal challenges to date; a lawsuit was dismissed before the tax went into effect and the Commonwealth Court upheld the tax last year. Opponents of the levy appealed that decision to the Supreme Court, which announced in January that it would consider the case.

Since the beverage tax went into effect at the start of 2017, it has raised more than $96 million, including nearly $18 million so far this calendar year, according to data provided Monday by the city.

Mayor Kenney's administration also announced in March that it would downsize plans for the programs the tax funds because it had not raised as much revenue as was initially predicted. The adjustments renewed criticism of the tax, which opponents say hurts local businesses and is unsustainable. City officials have maintained that it is still providing children with much-needed city programs.

The Supreme Court did not indicate when it would issue a decision.