LOS ANGELES, California (CNN) -- Los Angeles Police Chief William Bratton, who imposed sweeping reforms on his scandal-battered department after taking office in 2002, is resigning to take a job training police in developing nations, he announced Wednesday.
"There is never a good time to leave," William Bratton said, "but there is a right time."
Bratton took over when the department was under federal oversight, reeling from a major corruption investigation and with a long-standing reputation for brutality toward minorities.
Los Angeles Mayor Antonio Villaraigosa said Bratton is leaving behind a department "no longer bound by the misdeeds of the past."
"Because of him, Los Angeles is the safest it's been in more than half a century," Villaraigosa said. "He's leaving Los Angeles a stronger city, a more united city, a safer city."
Bratton's tenure was not entirely without controversy.
Police came under harsh criticism for their chaotic breakup of an immigration reform rally in May 2007, when officers attacked demonstrators and journalists. An investigation blamed a "command and control breakdown" on the part of senior officers, resulting in the demotion of a division commander and the reassignment of his second-in-command.
Bratton is taking a job with the Virginia-based corporate security firm Altegrity. He will lead a new division that is focused on training police and law enforcement officials in "post-conflict nations," teaching what he called "lessons learned in Los Angeles and New York."
"When you love what you do, when you love the people you get to do it with, when you love where you do it, there is never a good time to leave," Bratton said. "But there is a right time."
Bratton came to Los Angeles after stints as the top police official in New York and in his native Boston, Massachusetts.
His resignation will take effect October 31.