NEW YORK (Reuters) - Connecticut lawmakers passed a $40.7 billion two-year state budget early on Saturday, but Governor Dannel Malloy could veto the legislation and leave the state racing toward severe spending cuts next month.

Connecticut Governor Dannel Malloy speaks at the Democratic National Convention in Philadelphia, Pennsylvania, U.S. July 25, 2016. REUTERS/Lucy Nicholson

It was a surprise that the Republican-backed budget won over the legislature, which is narrowly controlled by Democrats. Malloy, a Democrat, said he would veto the bills as they first passed through the Senate before moving to the House of Representatives.

“The amended budget that passed in the Senate today is unbalanced, and if it were to reach my desk I would veto it,” Malloy said in a statement Friday night.

He said the budget “relies on too many unrealistic savings, it contains immense cuts to higher education, and it would violate existing state contracts with our employees, resulting in costly legal battles for years to come.”

Connecticut’s bi-ennial budget is more than two months late. When lawmakers failed to pass it by June 30, Malloy took emergency control of state spending.

Under his executive order, some schools and cities would see state aid slashed after Oct. 1 unless a budget is enacted before then.

One of the wealthiest state’s in the nation, Connecticut is hampered by $73 billion of pension and debt obligations, high taxes, outmigration and falling revenues.

Malloy is one of the most unpopular governors in the country and is not seeking a third term.

Democrats said on Thursday they had enough votes to pass a budget Malloy would sign, but that deal fell apart.

The budget now before Malloy contains some items he says he cannot stomach, including reductions to the University of Connecticut.

General fund appropriations would grow 3.5 percent in fiscal 2018 to $18.5 billion and 0.6 percent in fiscal 2019 to $18.6 billion.

The transportation fund, the next largest, would grow by about 11 percent over the two years, according to the legislature’s Office of Fiscal Analysis (OFA).

The bill would also limit general obligation bond allocations to $2 billion a year beginning in fiscal 2018, then apply that same cap to issuances and spending starting in fiscal 2019, the OFA said.

It would establish a Municipal Accountability Review Board to allow state oversight of fiscally troubled cities, potentially including its capital city Hartford.

Hartford Mayor Luke Bronin has said the city could soon file for bankruptcy if it does not receive roughly $45 million of state aid.