(Reuters) - A U.S. appeals court on Thursday blocked a San Francisco law requiring health warnings on advertisements for soda and other sugary drinks in a win to the American beverage industry which fought the requirements in court.

Mexican made Coca-Cola and 7UP bottles are seen at the Safeway store in Wheaton, Maryland February 13, 2015. REUTERS/Gary Cameron (UNITED STATES)

The 11 judges of the 9th U.S. Circuit Court of Appeals in a unanimous decision said the city’s ordinance violated commercial speech protected under the U.S. Constitution.

“The required warnings therefore offend plaintiffs’ First Amendment rights by chilling protected speech,” the judges wrote in granting a preliminary injunction that prevents the law from taking effect.

The judges said beverage makers were likely to suffer “irreparable harm” if the law is implemented because the warning would “drown out” the advertisements’ other visual elements.

The San Francisco ordinance is part of a national effort to curb consumption of soft drinks and other high-calorie beverages that medical experts have said are largely to blame for an epidemic of childhood obesity.

Over the past years, many U.S. localities have imposed taxes on sugary beverages, adding a surcharge of up to 1.75 cents per ounce (29 milliliters). At that rate, the cost of a typical 12-ounce can of soda would rise by 21 cents.

The beverage industry has opposed the measures, saying they hit poor and working-class families and small businesses the hardest.

The ordinance passed by San Francisco in June 2015 required advertisements on billboards and posters within city limits to include a warning that drinking high-sugar beverages contributes to obesity, diabetes and tooth decay.

A smaller, three-judge panel of the 9th blocked the law in 2017, saying it unfairly targeted one group of products. The entire 11-judge panel in January 2018 agreed to rehear the case.

The American Beverage Association, which in 2015 asked for the preliminary injunction, did not immediately respond to a request for comment on Thursday’s ruling.

San Francisco’s City Attorney Dennis Herrera, whose office defended the law in court, also did not immediately respond to a request for comment.