Bill Bratton is New York City's top cop again.

New York City Mayor-elect Bill de Blasio announced Thursday that the former NYPD commissioner will return to the post, replacing Ray Kelly.

De Blasio would be the second New York City mayor Bratton, 66, has served. Bratton spent his early career in Boston, rising to become chief of the force before he was recruited to come to New York in the mid-1990s.

"I will get it right in this city once again," Bratton said.

Bratton pledged to reform stop-and-frisk, calling it an "unnecessary intrusion" in the lives of New Yorkers.

He said NYPD officers must adhere to their constitutional obligations, that every member of public must "be treated respectfully" and that policing "must be done compassionately, it must be done consistently."

Bratton said "the goals will be quite simple."

Those goals include maintaining a low crime rate, establishing a collaborative relationship with other agencies to combat terrorism, and fulfilling "the mayor's dream" to bring the community together by establishing "mutual respect and trust."

De Blasio revealed the appointment, his second major personnel announcement of the week, at the Red Hook Community Justice Center.

Bratton has had an "extraordinary career of achievement," de Blasio said at a news conference. "Wherever he's gone, he has driven down crime."

"I want him to do what he knows how to do best," de Blasio said -- focus on criminals, make neighborhoods safer, and avoid focusing resources on innocent, hardworking New Yorkers.

De Blasio said he wants Bratton to "repair relations with the community" and reform stop-and-frisk policy.

As the first police commissioner under Mayor Rudy Giuliani between 1994 and 1996, Bratton earned plaudits for helping drive down crime by embracing community policing and the broken-windows theory of crime control. But Bratton wasn't publicity-shy, and that led to repeated clashes with his boss.

In an incident that soured the relationship, Bratton appeared on the cover of Time Magazine, with the headline, "Finally, we're winning the war against crime. Here's why." That reportedly infuriated Giuliani and led to Bratton's ouster.

After leaving the NYPD, Bratton went on to head the Los Angeles Police Department and was credited for helping to bring down crime there. He has been a private policing consultant, serving venues as varied as the United Kingdom and Oakland, Calif.

Still, Bratton coyly hinted for months that he'd be interested in again serving as New York City's police commissioner. At an appearance at New York University earlier this year, Bratton told reporters who asked him if he'd want the job: "Apart from being an optimist, I guess I'm a glutton for punishment."

De Blasio had also interviewed Philip Banks III, now chief of department under Kelly, and the first deputy commissioner, Rafael Pineiro, the NYPD's highest-ranking Hispanic.

Gov. Andrew M. Cuomo called Bratton's selection "a smart choice," noting that Bratton has a track record of reducing crime in Boston, Los Angeles and New York.

NYC Patrolmen's Benevolent Association president Patrick Lynch called Bratton "a solid choice."

"Commissioner Bratton has an international reputation as a problem solver and innovator," Lynch said in a statement. "His problem solving style has been to be inclusive of all parties affected by a problem and that's the best way to find solutions."

The mayor-elect has made a hallmark of his campaign reducing the public's high number of encounters with police under the NYPD's stop-and-frisk program -- and removing what he sees as its racially discriminatory taint.

In response to the announcement, the New York Civil Liberties Union issued a statement saying it is hopeful de Blasio and the new police commissioner will keep to the incoming mayor's pledge "to close the book on the tale of two cities."

"We look forward to working with the new mayor and police commissioner to ensure that fundamental changes are made to the NYPD, including a top-to-bottom culture shift that ends racial profiling and the abuse of stop-and-frisk," executive director Donna Lieberman said.

The Rev. Al Sharpton said in a statement that when Bratton last served in New York City "we had a very distant and adversarial relationship," but when he served the Los Angeles Police Department they "worked closely on gang violence and police misconduct matters."

"Mr. Bratton knows of my concerns and the concerns of others about racial profiling in stop and frisk policing but at the same time is aware of our desire to continue the decrease of violence and crime in our community," Sharpton said.

At an appearance at the Harvard Club this summer, Bratton blamed the quantity of stops on the use of inexperienced police officers. Bratton said that policing must be consistent citywide, no matter how rich, poor, black or white a neighborhood may be.

When Bratton took over the LAPD in 2002, he pledged to regain the trust of the community -- something de Blasio has said is a must for the next police commissioner: to repair the relationship between police and community.

Bratton would take the reins from Kelly, who himself served a second tour as New York City's top cop under Bloomberg after working for David Dinkins in the early 1990s. With 12 years in the post, Kelly is the city's longest-serving police commissioner.

The announcement of Bratton's appointment comes one day after De Blasio named government veteran Anthony Shorris, senior vice president of New York University Langone Medical Center and former Port Authority executive director, as his first deputy mayor.