ALBANY — Gov. Andrew M. Cuomo and legislative leaders agreed Monday to enact emergency stopgap measures to meet payroll and avoid a state government shutdown, while making little if any progress toward passing the late budget.

The emergency legislation, appropriating $40 billion, would keep government operating until May 31. It could be supplanted by a full budget if lawmakers can reach an accord.

The Senate approved the emergency measures 46-15 and the Assembly followed suit, 107-35, around 6:35 p.m. after a lengthy debate.

For days, Cuomo blamed legislators for failing to come to an agreement, and on Monday several legislators (liberal and conservative) lashed back at him.

“Finally, after six years, this Legislature is pushing back against his thug nonsense,” Assemb. Steve McLaughlin (R-Schaghticoke), one of Cuomo’s most vocal critics, said, referring to the governor’s tenure. “He ran his mouth for months about dysfunction in Washington and he can’t get a budget on time.”

He wasn’t the only one to refer to what many believe is Cuomo’s national aspirations.

advertisement | advertise on newsday

“We are the Legislature. We are not the platform committee for ‘Cuomo 2020’,” Assemb. Fred Thiele (I-Sag Harbor) said as the Assembly debated the emergency spending bill.

Cuomo, a night earlier, blamed the federal government, an “ultra-conservative Congress,” and the Senate and Assembly, citing “the inability of both houses to reach an agreement.”

Lawmakers vowed to continue negotiations, but they face a key fork in the road on Wednesday: that’s the day the legislature is set to adjourn for an 18-day Passover/Easter break. Some lawmakers want to keep working all week to complete the task before going on holiday, but the legislature’s top Republican suggested the protracted negotiations may continue through the break.

“I think we can have a budget by the time we come back,” Senate Majority Leader John Flanagan (R-East Northport) said.

In contrast, Sen. Jeff Klein (D-Bronx), head of a group of breakaway Democrats who formed a governing coalition with Republicans, said he hopes “cooler heads prevail” and that lawmakers come to an agreement “in the next couple of days.”

This is the first time in his seven years in office that Cuomo has faced a shutdown — he routinely had touted his on-time budgets in his re-election campaign.

Lawmakers defended the emergency action in the wake of a stalemate.

“Passing the extender isn’t a punt of our duties,” said Assembly Speaker Carl Heastie (D-Bronx). “I’m just trying to make sure that government isn’t shut down and people who work hard for the State of New York, the school districts and hospitals continue to be able to do the work that they do.”

He said he will meet with Flanagan to try to come to a deal before the legislature goes on break on Wednesday.

The budget has been hung up on complex policy issues inserted into the talks by Cuomo. Key disputes focus on whether to raise the age of criminal responsibility from 16 to 18 (backed by many Democrats); expand charter schools (a Republican initiative); and renew a tax break for developers ((backed by Cuomo and the GOP).

advertisement | advertise on newsday

The governor, besides blaming Washington, said he wasn’t willing to give in too much on some of the key sticking points.

Cuomo included funding for several previously announced projects in the extender. On Long Island, the projects include $20 million to connect MacArthur Airport with the Long Island Rail Road, $40 million for water quality projects in Smithtown and Kings Park, $130 million to accelerate reconstruction of the Nassau Expressway and $564 million for the nearby Kew Gardens Interchange as part of the renovation of Kennedy Airport.

The extender will allow the state to meet payroll for about 149,575 state agency workers and to pay other obligations. The May 31 date was chosen because it’s 10 days past the expected release of the federal budget.

“It is likely some state employees could get their pay later than usual due to the late passage of the extender,” said Jennifer Freeman, spokeswoman for state Comptroller Thomas DiNapoli.