Mayor Bill de Blasio on Tuesday announced Police Commissioner Bill Bratton is stepping down and will be replaced by Chief of Department James O'Neill. Dean Meminger filed the following report.

After weeks of speculation and denials that William Bratton would be leaving as police commissioner imminently, he made it official Tuesday, standing with Mayor Bill de Blasio.

"I made it quite clear that I would leave when I thought the time was right," Bratton said.

Bratton is resigning after two-and-a-half years.

"I worked very hard over the last couple years with the mayor to recognized that there would become a point in time, whether it is now or a year from now, that I would leave. Police is never done. It is always unfinished business."

There was speculation Bratton is stepping down for multiple reasons, from the mayor firing him, to poor health, to federal investigations into the NYPD or because of community activists.

"I've never had a concern about being fired by this mayor because effectively, we work so well together," Bratton said.

Bratton has never been shy about saying he lost money to become police commissioner the second time around and was always going back to the private sector for financial reasons. This time he'll be working for a CEO advisory firm called Teneo.

"I'm going into a related world where I'll be able to use the expertise that was developed, particularly over the past several years, dealing with cybercrime and terrorism and take that into the private sector," he said.

Bratton will officially leave in September. The top bosses in the department will basically stay the same. Chief of Department James O'Neill will be bumped up to police commissioner. Carlos Gomez will be chief of department, and Ben Tucker will stay on as first deputy commissioner.

"Better to leave at this juncture where there is a team that is capable, energetic and is creative and wants to engage, and you've met them and you know them," Bratton said.

"We've all been a team together," de Blasio said. "This is something, again, that I cannot say enough about Bill Bratton's understanding of teamwork."

Bratton leaves as overall crime remains at historic lows and additional officers are being added to the department with upgraded equipment.

Although Bratton says the police department has accomplished a lot over the last two-and-a-half years, he admits there are still plenty of challenges ahead for the NYPD, especially with community-police relations.

Activists cheered his departure as he left City Hall. But unlike when he was forced out as commissioner in the 90's by then mayor Giuliani, he says this time was on his terms and at the right time.

"I'm leaving with reluctance," he said. "I wish I had more time chronologically to stay around for three or four years to work on the issues that are going to take that long to straighten out. I don't have that time."

Bratton says he'll be staying in New York City but doesn't plan to meddle in police matters once his out the door.