Commissioner Bill Bratton is retiring to take a job in the private sector and will stay on with the department until next month. The announcement came during a news conference at City Hall.
He'll be succeeded by Chief of Department James O'Neill -- the NYPD's top uniformed officer. The transition will happen in September.
RELATED: Who is James O'Neill, NYC's new police commissioner?
Bratton, 68, recently told the The New York Times that he would not remain commissioner past 2017, but Tuesday's sudden announcement was a surprise to many.
During that interview, the commissioner said he's "still young enough" to take on "additional challenges." He also said he's already created a line of succession.
De Blasio said Bratton told him of his decision to step down July 8. From there, NYPD officials were internally notified about the succession for chief of department position.
PHOTOS: Bill Bratton through the years
He also posted a message to the NYPD:
It was revealed later Tuesday that Bratton is going to work for Teneo Holdings, a CEO advisory firm, as senior managing director and executive chairman of the company's new division, Teneo Risk.
De Blasio called Bratton's contributions to the city "inestimable and extraordinary," while heralding O'Neill as someone who would "take this department where it's never been before" by leading a push toward neighborhood policing, or trying to build trust and working relationships between law enforcement and communities. O'Neill has been heavily involved in the city's plans to shift toward that strategy; de Blasio said neighborhood policing would be in place in 51 precincts as of this fall.
"We've tried to redefine our relationship from being the police to being your police," Bratton said.
Bratton's resume is unmatched in local law enforcement. He began his career as a patrolman in Boston in 1970 and went on to lead law enforcement agencies in Boston, Los Angeles and New York.
In his first tenure at the NYPD under Mayor Rudolph Giuliani in the early 1990s, he was credited with driving down crime with a widely copied, data-driven, crime-fighting strategy before his brash style made him an annoyance to the mayor, who forced him out.
Still, the local police unions wasted little time responding after Tuesday's announcement.
"We thank Commissioner Bratton for his service to New York City during a very challenging period for the NYPD and its members," PBA president Patrick J. Lynch said in a statement. "We wish him well in his new endeavors. We hope that Chief O'Neill will make supporting and protecting police officers on the street his first priority when he assumes his new role. We look forward to working with him to make sure that New York City police officers are fully supported, with the fair compensation, staffing, equipment and training that we need to protect all New Yorkers."
"Commissioner Bratton is finally doing what is right for the members of the NYPD and the people of New York City," SBA president Ed Mullins said. "We wish him well and look forward to a new direction for the NYPD."
Stay with abc7NY for the latest on this developing story.