Large fizzy drinks were about to become a thing of the past in New York City restaurants, but at the last minute the court decided not to ban them.
Judge Milton Tingling thought the measure was unnecessary.
The law would have forbidden the sale of drinks larger than 473ml in places serving food - ranging from pizzerias to sports stadiums and cinemas, though not at supermarkets or shops.
Mayor of the city, Michael Bloomberg, said the judge was wrong and wants to appeal against the ruling.
He thinks the ban will reduce the number of people who are overweight.
According to research, 58% of adults in New York are obese.