The US’s most high-profile police officer, New York City commissioner Bill Bratton, has resigned after months of political tussling with the city’s mayor.

Mayor Bill de Blasio announced Bratton’s 1 September departure at a hastily organized press conference on Tuesday.

“In September, Commissioner Bratton will retire from the NYPD,” announced De Blasio, who called Bratton’s contributions to law enforcement “inestimable and extraordinary”.

The new police commissioner will be chief of department James O’Neill. O’Neill has been an NYPD officer since 1983, and was promoted to his current role in 2014.

“Jimmy is one of the best-prepared incoming police commissioners this city has ever seen,” said De Blasio.

The mayor said O’Neill would focus on neighborhood policing, creating a “true deep bond” between community and police.

Bratton was appointed by De Blasio in December 2013. Relations have been strained between the pair, with arguments over the numbers of new police officers, criticisms of racist policing and struggles over the city council.

Bratton had already said that he would not stick around for a second term as De Blasio’s police commissioner.

This was Bratton’s second time serving as police commissioner of New York City – he also served under Rudy Giuliani, before heading to Los Angeles in 2002 to run the LAPD. He then worked for several years in the private sector before De Blasio convinced him to be his top cop two years ago. Bratton will return to work in the private sector.

The news comes just one day after Millions March NYC, a Black Lives Matter-aligned group, began the #ShutDownCityHallNYC protest, taking over the park next to city hall in Manhattan and sleeping overnight in another nearby park that was open 24 hours a day in order to avoid arrests by police. One of their demands was to have Bratton removed as police commissioner.

At Tuesday’s press conference, De Blasio said community protests and demands for Bratton’s resignation had nothing to do with his surprise exit.

“One hundred and ten per cent has nothing to do with [his departure],” De Blasio said Tuesday. The mayor said Bratton had told him on 8 July that he planned to leave for a job in the private sector and that they had quickly assembled a team to lead the department. Bratton and De Blasio declined to say where the former commissioner would work next.

Josmar Trujillo, the leader of the protest group New Yorkers Against Bratton, welcomed the news of Bratton’s departure. “Long time coming. [He] should have never been here,” he told the Guardian, noting that Bratton’s “broken windows” policing, implementation of CompStat (which collects crime data) and plans for predictive policing technology would outlast their champion.

“I’m going to keep my eyes on Bill Bratton in the private sector and make sure his replacement, James O’Neill, feels the same pressure,” said Trujillo.