A state judge ruled Thursday that Gov. Andrew Cuomo and the Legislature broke the law last year when they punted an overhaul of the state’s election laws and campaign finance regulations to an unelected panel.

Niagara County Supreme Court Justice Ralph Boniello declared in an 11-page ruling that the law — which was tucked in last year’s state budget — amounted to “an improper and unconstitutional delegation of legislative authority.”

The appointed Public Finance and Elections Commission recommended stricter contribution limits for statewide and legislative campaigns, while instituting a new matching funds program for candidates.

It also lifted requirements making it more difficult for minor parties to maintain ballot status — from 50,000 votes to 130,000.

The recommendations from the commission — whose members included Cuomo ally and state Democratic Party chairman Jay Jacobs — became law when the Legislature took no action in December, but kick in with the 2026 campaign.

“This ruling is a victory for the voters of New York State. We need more choices, not fewer, to build a strong democracy,” said Working Families state party chief Sochie Nnaemeka, a plaintiff in the case. “As we have consistently said and the courts confirmed today, an unelected commission has no right to interfere with New Yorkers’ constitutional right to fusion voting.”