State Supreme Court Justice Milton Tingling said the 16-ounce limit on sodas and other sweet drinks arbitrarily applies to only some sugary beverages and some places that sell them.
"The loopholes in this rule effectively defeat the stated purpose of this rule," Tingling wrote in a victory for the beverage industry, restaurants and other business groups that called the rule unfair and wrong-headed.
In addition, the judge said the Bloomberg-appointed Board of Health intruded on the City Council's authority when it imposed the rule.
The city vowed to appeal the decision, issued by New York state's trial-level court.
"We believe the judge is totally in error in how he interpreted the law, and we are confident we will win on appeal," Bloomberg said, adding that the city would emphasize to higher courts "that people are dying every day. This is not a joke."
For now, though, the ruling means the ax won't fall Tuesday on supersized sodas, sweetened teas and other high-sugar beverages in restaurants, movie theaters, corner delis and sports arenas.
"The court ruling provides a sigh of relief to New Yorkers and thousands of small businesses in New York City that would have been harmed by this arbitrary and unpopular ban," the American Beverage Association and other opponents said.
While some eateries had held off making changes because of the court challenge, some restaurants had begun using smaller glasses for full-sugar soda. Dunkin' Donuts shops have been telling customers they will have to sweeten and flavor their own coffee. Coca-Cola has printed posters explaining the rules.
Frames Bowling Lounge developed - and is keeping - a slate of fresh-squeezed juices as an alternative to pitchers of sodas for family parties, investing staff time, buying new glasses and changing menus.
"All that cost a lot of money - but you have to go with the flow," executive general manager Ayman Kamel said. Customers have started calling about the new juices, and "we're all very excited about it," he added.
Bloomberg urged businesses to comply despite the court ruling, and not just because the city may yet prevail.
"If you know what you're doing is harmful to people's health, common sense says if you care, you might want to stop doing that," he said.
The first of its kind in the country, the restriction has sparked reaction from pizzeria counters to late-night talk shows, celebrated by some as a bold attempt to improve people's health and derided by others as another "nanny state" law from Bloomberg during his 11 years in office.
On his watch, the city has compelled chain restaurants to post calorie counts, barred artificial trans fats in restaurant food and prodded food manufacturers to use less salt. The city has successfully defended some of those initiatives in court.
Because of the limits of city authority and exemptions made for other reasons, the ban on supersized beverages doesn't cover alcoholic drinks or many lattes and other milk-based concoctions, and it doesn't apply at supermarkets or many convenience stores - including 7-Eleven, home of the Big Gulp.
The rule, if upheld, would create an "administrative leviathan," warned Tingling, who was elected to the Supreme Court bench in 2001 as a Democrat.
The health board has considerable regulatory power, but its limits will likely be a central question in the appeal.
"I think it turns on whether the appellate division feels that the mayor has gone too far in ruling by decree in bypassing City Council," said Rick Hills, a New York University law professor who has been following the case.
In defending the rule, city officials point to the city's rising obesity rate - about 24 percent of adults, up from 18 percent in 2002 - and to studies tying sugary drinks to weight gain.
Critics said the measure is too limited to have a meaningful effect on New Yorkers' waistlines. And they said it would take a bite out of business for the establishments that had to comply, while other places would still be free to sell sugary drinks in 2-liter bottles and supersized cups.
The city had said that while restaurant inspectors would start enforcing the soda size rule in March, they wouldn't seek fines - $200 for a violation - until June.
The ruling "serves as a major blow to Mayor Michael Bloomberg's incessant finger-wagging," said J. Justin Wilson at the Center for Consumer Freedom, created by restaurants and food companies. "New Yorkers should celebrate this victory by taking a big gulp of freedom."
Jose Perez, a fifth-grade special education teacher in Manhattan who was getting a hot dog and can of soda from a street vendor, called the ruling "dead-on."
"Really, I think it's just big government getting in the way of people's rights," he said. "I think it's up to the person. If they want to have a giant soda, that's their business."
Associated Press writers Meghan Barr and Deepti Hajela contributed to this story