After weeks of haggling by state lawmakers — and a day spent huddling behind closed doors — the stage is set for a possible two-year extension of Mayor Bill de Blasio’s control of city schools.

The Assembly passed a bill in the wee hours of Thursday morning that outlines both the extension and a number of other provisions, including the reauthorization of local taxes and the renaming of the Tappan Zee Bridge for the late Governor Mario Cuomo. Notably, it does not include sweeteners for charter schools, which Assembly Speaker Carl Heastie has forcefully opposed.

The state Senate is expected to return for a vote Thursday afternoon, though it is not yet clear if a deal has been reached. Scott Reif, a spokesman for Senate Majority Leader John Flanagan, did not confirm a final agreement, but told reporters Wednesday night that negotiations were “moving in the right direction.”

RELATED: How does de Blasio grade on his education promises?

According to Politico, the text of the bill was released just before 11:30 p.m. and passed the Assembly around 1 a.m., by a vote of 115-15.

The bill was passed in an “extraordinary session” called by Governor Andrew Cuomo this week after lawmakers failed to reach a deal during the regular legislative session, which ended last Wednesday. Mayoral control is set to expire Friday at midnight, an imminent deadline that’s led to a flurry of “what-ifs.”

If the Senate approves the deal, it would be a victory for Mayor Bill de Blasio, who has repeatedly sought multi-year extensions but been granted only one-year reprieves. It would also allay the fears of education experts on both sides of the political aisle, who have spoken out on the need to retain mayoral control rather than returning to a decentralized system run by 32 community school boards.

RELATED: Inside the schools excluded from NYC's improvement efforts

Losing mayoral control “would be devastating,” wrote schools Chancellor Carmen Fariña in a June 19 op-ed. “If Albany lets mayoral control lapse, there will be no one accountable for progress.”

But not everyone was pleased with the way things have gone down this week. “Today’s extraordinary session produced nothing to celebrate,” wrote Assembly Minority Leader Brian Kolb in a statement released after the vote. “There is no victory in completing work that should have been done weeks ago. No one deserves applause for passing bills in the middle of the night out of public view.”

This story was originally posted on Chalkbeat, a nonprofit news site covering educational change in public schools.