An appeals court today dealt another blow to Mayor Michael Bloomberg’s proposed soda ban, calling the controversial regulation “invalid” because it violates “the principle of separation of powers.”

Writing for the Appellate Division, Justice Renwick also criticized Bloomberg and the Health Department for proposing a ban with giant loopholes, which would exclude colas and energy drinks but allow milkshakes and fruit juices. Similarly businesses like delis and restaurants were prevented from hawking sugary beverages but 7-Elevean could still sell its signature Big Gulp.

The judicial panel said those inconsistencies go “beyond health concerns, in that it manipulates choices to try to change consumer norms.”

In March, a lower court judge first rejected the ban that stropped city restaurants, delis and other businesses from selling large sugary drinks, just a day before it was scheduled to launch.

Manhattan Supreme Court Justice Milton Tingling slapped Bloomberg and his Board of Health for overstepping their bounds this spring.

Today the four-judge Appellate Division panel agreed.

“Like the Supreme Court, we conclude that in promulgating this regulation the Board of Health failed to act within the bounds of its lawfully delegated authority,” Justice Dianne Renwick wrote in the unanimous ruling.

The judges said legislature should decide the issue.

Mayor Bloomberg called the decision “a temporary setback,” in his crusade to reduce obesity in the Big Apple, adding that he planned to submit an appeal to the state’s highest court.

A diverse group of organizations from the American Beverage Industry to the Hispanic Chamber of Commerce sued last fall claiming the 16-ounce cap rule “imposed social policy by executive fiat.”

A spokesman for the ABA said, “We are pleased that the lower court’s decision was upheld.”

The panel’s opinion echoed Judge Tingling’s comment that Mayor Bloomberg was heavy-handed in the process.

“Despite the City’s argument to the contrary, the Board did not bring any scientific or health expertise to bear in creating the Portion Cap Rule,” Justice Renwick wrote today. “Indeed, the rule was drafted, written and proposed by the Office of the Mayor and submitted to the Board, which enacted it without substantive changes.”

In a statement blasting today’s ruling, Bloomberg noted that since the ban was shot down in March “more than 2,000 New Yorkers have died from the effects of diabetes.” He said that both diabetes and obesity “are disproportionately linked to sugary drink consumption.”