The agreement, which still requires the approval of the Assembly and the Senate, enables the governor to claim credit for brokering a deal out of a fractious legislative environment. But the agreement announced on Friday evening — long after many in the state had tuned out the frustration in Albany — also marked the inglorious end of Mr. Cuomo’s streak of on-time or close to on-time budgets, something that dated to his inauguration in 2011.

Faced with what Mr. Cuomo called the threat of deep federal cuts from the Trump administration, the budget also builds in a mechanism that would allow the state to respond to cuts from Washington, financial flexibility that would allow the state’s Division of the Budget to “correct the state budget for that shortfall,” he said.

For all of that uncertainty, Mr. Cuomo seemed satisfied with the “hardest budget” he had overseen, including a longstanding priority for liberal groups: raising the age of criminal responsibility to 18, a deal that had snagged negotiations on several occasions. Under the deal announced by the governor, beginning in October 2018, many 16- and 17-year-old offenders would be processed through family court rather than criminal court.

But Mr. Cuomo had also seemingly paid a political price for the practice of putting high-profile and often politically valuable policies into the budget process, a longstanding if contentious practice in Albany. Such issues were consistently cited as stumbling blocks for a deal, particularly by Republicans, and led to several moments of stalled talks.

The governor’s relationship with the Legislature as a whole was also put in sharp relief during the negotiations: Mr. Cuomo had effectively denied a raise to lawmakers last fall, and hard feelings may have carried over to this spring’s talks. The Legislature was not to be paid during the so-called emergency extender budgets passed on Monday, though the governor was — something that became another sticking point during talks.