ALBANY - Gov. Andrew Cuomo and state legislators reached an agreement Friday night on the spending plan for the 2014-15 fiscal year, shortly before their midnight deadline.

The $138 billion budget includes tax breaks for homeowners and an additional $1.1 billion in education spending.

Homeowners will receive checks equal to the amount that their property taxes rose, as long as their local government stayed within the state's 2 percent tax cap. The rebate plan extends into the following year, but only if local town and school districts take steps to cut costs.

Some legislators didn't want such strings attached to the tax plan, but Gov. Cuomo fought for them as a way to encourage municipalities to shrink their costs.

"I do believe that will create a pressure on the local governments to find efficiencies," Cuomo said. "Families feel pressure at the kitchen table to make ends meet. For governments, the answer always can't be, 'We'll raise taxes.'"

Aid to schools statewide will rise 5 percent over last year, but it's not yet known how much each individual district on Long Island will receive.

The budget also contains tax breaks for manufacturers, corporate tax cuts and a reduction in the estate tax.

The Legislature voted down a proposal to fund speed cameras in school zones. Both Nassau and Suffolk counties were counting on those cameras to bring in millions of dollars in revenue.

After weeks of negotiations, the details weren't finalized until shortly before the midnight deadline for an on-time budget. It means legislators will have to comb through thousands of pages of documents before they officially vote on the budget on Monday, but the down-to-the-wire scrambling wasn't much of a surprise.

"The race to the finish line was typical chaos for Albany," says Yancey Roy, chief of Newsday's Albany bureau. "No one gives in early. They wait until the last second, until you absolutely know you have to make a deal right now."

Legislators will reconvene Sunday to comb through thousands of pages of documents. The spending plan is scheduled to be approved by the State Legislature Monday, before the midnight deadline for an on-time budget.