The NYPD will hire almost 1,300 more cops, under a deal struck by Mayor Bill de Blasio and City Council Speaker Melissa Mark-Viverito.

The deal is a concession that follows months of the mayor insisting the city didn't need any more officers and the money should go to other budgetary needs.

Relenting to pressure from the council and his own police commissioner, de Blasio and his budget negotiators agreed to the first major head count increase in years: boosting the force beyond its current 35,000 officers. The pact came Monday as part of the $78.5 billion budget deal for the 2016 fiscal year, which starts July 1 of this year.

The deal was sealed late Monday night with a ceremonial handshake in the City Hall rotunda.

All of the 1,297 officers to be hired are expected come aboard by next July. About 300 cops will be focused on counterterrorism, and the rest will be part of a "pioneering neighborhood policing strategy."

"What it means is really a comprehensive new approach that revolutionizes the way we bring police and community together," de Blasio said in announcing the agreement.

advertisement | advertise on newsday

He said more details will be released in coming days.

The officers' cost is about $170 million, with savings of about $70 million from civilianization of some jobs currently done by cops and an overtime cap. The administration did not yet have details of what the cap entails.

For months, de Blasio had said the NYPD could protect the city from terrorism and keep crime at record lows with its current resources. At the same time, Police Commissioner William Bratton repeatedly said he needed the cops, expected to get them and aligned himself with the council on the issue.

De Blasio's proposed budget, released in May at $78.3 billion, provided for no increase. The council had asked for 1,000 officers. The council said the new police officers are needed to help the NYPD do so-called community policing, repair relationships with minority communities and control overtime costs.

A similar effort last year by the council to hire more officers was unsuccessful, but the council, led by Mark-Viverito (D-Manhattan), renewed the push this year. The budget also provides a $1.4 million bail fund to keep the poorest defendants arrested on low-level charges out of jail.

Get the Newsday Now newsletter!

The best of Newsday every day in your inbox.

Foes of Bratton and his policing philosophy have held demonstrations and taken to Twitter to protest any increase in the force. Monday night, Josmar Trujillo of New Yorkers Against Bratton accused the mayor and council of "appeasing the police commissioner" and police unions. "We'll have something to say about this in the streets soon," he said.