A divided panel of the U.S. Court of Appeals for the Second Circuit in Manhattan found United Parcel Service liable Thursday for shipping thousands of cartons of untaxed cigarettes, but slashed its required payout from $247 million to $97.6 million.

The case was brought against Atlanta-based UPS by New York City Corporation Counsel and the state Attorney General's Office. UPS was represented in the case by a team of attorneys from Gibson, Dunn & Crutcher and Morrison & Foerster.

The majority agreed with a Manhattan trial court that UPS violated federal anti-cigarette trafficking laws and New York's health law by transporting contraband smokes from Native American reservations to customers throughout the city and state.

However, the court found that former U.S. District Judge Katherine B. Forrest of the Southern District of New York was wrong when she ordered UPS to hand over $9.4 million in unpaid cigarette taxes and $237.6 million in penalties and damages. The ruling reduced UPS's civil penalties to just $78.8 million, but doubled the package-delivery giant's tax liability from $9.4 million to $18.8 million.

The ruling came in a 2015 lawsuit by New York City and state, which accused UPS of intentionally violating the federal Contraband Cigarette Trafficking and Prevent All Cigarette Trafficking Acts, as well as breaching a settlement agreement with the state Attorney General's Office to audit suspect shippers and to stop shipping unstamped cigarettes within the state.

The city and state reached an agreement last year to settle similar claims against FedEx Corp. for $35 million, and New York Mayor Bill de Blasio and California Attorney General Xavier Becerra in October sued the U.S. Postal Service over other alleged shipments of contraband cigarettes through international mail.

On Thursday, the panel found that Forrest's analysis had punished UPS under two statutes for essentially the same conduct, and said an additional penalty wasn't necessary to fight unlawful cigarette-trafficking, collect taxes and increase public health.

"The $240 million penalty originally imposed by the district court, and even the $160 million penalty that remains in the wake of our correction to the district court's erroneous calculation of penalties under the [settlement], is far too large a pill to swallow for the conduct at issue here," Second Circuit Judge Gerard E. Lynch wrote in a 115-page majority opinion.

"Thus, under our reading of the sentencing guidelines, the $18.8 million in unpaid taxes lost by the state and city would permit a sentencing court to impose a fine up to $75.2 million, a far smaller financial penalty for a criminal violation than the district court imposed for a civil offense," Lynch said.

He was joined by U.S. District Judge Lawrence J. Vilardo of the Western District of New York, who sat by designation in the case.

Second Circuit Judge Dennis Jacobs, however, in a partial dissent, said that he would vacate the awards altogether, with instructions for the district court to determine if penalties were appropriate. Based of the court's findings, he said, those would amount to about $30 million, a "quite considerable penalty for failure to monitor a minute fraction of the parcels shipped by UPS."

A spokesman for UPS said the company was still "reviewing the lengthy majority and dissenting opinions and will consider further appellate relief."

New York City Corporation Counsel James E. Johnson, meanwhile, called the ruling a "big win for New Yorkers and our public health laws." Of the total payout assessed against UPS, he said, the city would receive about $39 million.

"In upholding millions of dollars in civil fines and doubling the damages award, the court has sent a powerful message to companies: Do not illegally transport untaxed cigarettes; it will cost you," Johnson said in a statement.

"We will continue to hold companies accountable for their misconduct that harms public health," he said.

The New York AG's Office did not immediately respond Thursday to an email seeking comment on the decision.

UPS was represented in the case by Mark Perry, Christopher Baum and Aidan Taft Grano of Gibson Dunn in Washington, D.C., and Caitlin J. Halligan from the firm's New York office. Morrison & Foerster's Deanne E. Maynard and Paul T. Friedman also represented the company.

The case was captioned State of New York v. United Parcel Service.

Read More: