A New York state appeals court handed N.Y.C. Mayor Michael Bloomberg a supersized disappointment on Tuesday when it affirmed a state judge’s ruling blocking the city’s ban on large sugary drinks.

A four-judge panel of the state’s Supreme Court Appellate Division, said that the city’s Board of Health exceeded its authority when it passed the ban, which would have banned the sale of sugary drinks of larger than 16 ounces.

The judges took issue with Bloomberg’s decision to circumvent the city council (a legislative body) and instead seek approval for the measure from the executive agency Board of Health. The city had argued that the board had the power to regulate issues that affected public health in the city.

In response, the court raised the issue of the ban’s many loopholes, including exemptions for milk- or alcohol-based drinks, or beverages sold at grocery and convenience stores. “We find particularly probative the regulation’s exemptions, which evince a compromise of social and economic concerns, as well as private interests,” the court said. “The Board of Health’s explanations for these exemptions do not convince us that the limitations are based solely on health-related concerns.”

Bloomberg, who will step down as mayor at the end of this year, said that he will continue to fight for the ban’s passage, the Wall Street Journal reports. In a statement, the mayor cited the American Medical Association’s recent decision to classify obesity, which is linked to excessive soda consumption, as a decision.

For more InsideCounsel coverage of the soda ban, see:

Appeals court to consider NYC soda ban

NYC appeals decision to strike down sugary drink ban

Judge strikes down NYC sugary drink ban

New York City grants three-month reprieve from sugary drink fines

Beverage industry groups sue to block NYC sugary drink ban