The NYPD will shift 200 police officers to street duty from desk duty, and every public middle schooler, rich or poor, will be eligible for free lunch, under a budget deal struck last night between the mayor and the New York City Council.

The deal, $75 billion for the 2015 fiscal year that begins July 1, came at nightfall after weeks of negotiations between the two sides.

Democratic Mayor Bill de Blasio and his close ally, Council Speaker Melissa Mark-Viverito (D-East Harlem), consecrated the deal with a traditional handshake in the rotunda of the centuries-old City Hall.

"This is just plain progress," he said of the new street cops.

It's their first budget as mayor and speaker, and it reflects between $100 million and $200 million more in spending than the mayor had proposed earlier this year, a de Blasio budget official said.

Citing a spike in shootings and violence at the city's public-housing projects, the council had sought the addition of 1,000 new police officers to the 35,000-strong force. But although more officers will return to do enforcement, the overall head count will not increase, officials said. NYPD Commissioner William J. Bratton said though he would welcome more cops, the city could not afford to fund the additional officers.

The budget includes $6.2 million to hire 200 police aides, to allow the cops who currently hold those clerical jobs to go back to crime fighting.

De Blasio said the plan would "get those cops out to the streets where they can help protect people."

"We're coming out of this process, not with everything we wanted, but comfortable with what we've accomplished," said City Councilman Ydanis Rodriguez (D-Washington Heights).

The free lunch program will cost $6.25 million and will start this September citywide.

One of the biggest chunks announced last night was $32.5 million spent for mental health care and services in the city's jails.