Gov. Cuomo has vetoed a bill that would have put the state on the hook for legal bills for defendants too broke to hire a lawyer themselves.

His veto came late Saturday night — New Year’s Eve.

But the governor’s spokesman insisted the timing was not an attempt to bury news that sparked widespread criticism by civil liberties groups and public defenders.

“Until the last possible moment, we attempted to ‎reach an agreement with the legislature that would have achieved the stated goal of this legislation, been fiscally responsible, and had additional safeguards to ensure accountability and transparency,” said spokesman Richard Azzopardi.

“Unfortunately, an agreement was unable to be reached and the legislature was committed to a flawed bill that placed an $800 million burden on taxpayers,” he said, adding that Cuomo would revisit the issue later this year.

Those in favor of the bill said it would not only protect the rights of defendants but also save counties a pile of cash by transferring the cost of the legal bills from the counties to the state over seven years.

Supporters were furious over the veto.

“We are deeply disappointed that the governor has vetoed the most important criminal justice reform legislation in memory,” said New York Civil Liberties Union head Donna Lieberman.

“He has rejected a groundbreaking and bipartisan fix to our deeply flawed public defense system and left in place the status quo, in which the state violates the rights of New Yorkers every day and delivers unequal justice.”

The legislature enacted the bill requiring the state to cover the costs of lawyers for indigent defendants after the state settled a 2014 lawsuit brought by the Civil Liberties Union that charged the current, county-based system wasn’t providing counsel as required by law. Coumo’s office said the legislation was much broader than what the settlement required.