The successor to departing New York City Police Commissioner Bill Bratton has been called a "cop's cop," but his career with the NYPD was nearly done in by scandal.
Chief of Department James O'Neill was in charge of the narcotics division in 2008 when the department was rocked by reports that undercover officers had taken sexual favors, drugs and cash from the junkies and dealers they were supposed to be busting.
While O'Neill himself was not accused of wrongdoing, he paid a political price.
O'Neill was transferred to the far less prestigious fugitive enforcement division and was reportedly thinking of quitting the NYPD and getting a gig in the private sector when he reached out to his old friend Bratton for advice in March 2013, according to the Wall Street Journal.
Bratton, who at that point was less than a year away from returning to New York for his second stint as NYPD commissioner, convinced O'Neill to stay put. O'Neill took Bratton's advice and it appears to have paid off.
Last month, when Bratton announced his plans to eventually step down as New York City's top cop, O'Neill's name quickly surfaced as a candidate to replace him.
"I love what I do," O'Neill, 60, said tactfully at the time as Bratton and Mayor Bill de Blasio stood beside him. "I love being a cop. I love this uniform, so however I can serve this city. I enjoy this and I enjoy seeing what the greatest men and woman of the NYPD do every day."
Bratton, in announcing his resignation Tuesday, said O'Neill will make a fine commissioner.
O'Neill "has all it takes to lead the NYPD into the future," he said.
Former NYPD commissioner Ray Kelly, the guy who transferred O'Neill from narcotics to fugitive enforcement, agreed.
"He is an experienced professional who came up through the ranks of the NYPD," Kelly said.
Unlike the Boston-bred Bratton, O'Neill is from Brooklyn and started at the NYPD in 1983 as a beat cop patrolling the subways.
Bratton promoted O'Neill to second highest-ranking officer in the NYPD shortly after de Blasio took office in 2104.
Bratton tasked O'Neill with the politically charged task of leading the department's neighborhood policing efforts to ease tensions with the black and Hispanic communities while keep crime down.
O'Neill spearheaded the creation of neighborhood coordinating officers whose job is to get to know the people in the precinct, not just bust them.
And it was O'Neill who was tasked with creating an NYPD unit specifically designed to deal with mass demonstrations and protests like the ones that roiled the city in 2014 after a Staten Island grand jury opted not to indict a police officer for the choke-hold death of Eric Garner.
During his stint as Bratton's No. 2, the number of stop-and-frisks — a tactic employed by the NYPD that so outraged poor and minority communities — dropped sharply. So too did the number of arrests and summonses issued.
While the new tactics were not always eagerly embraced by beat cops, O'Neill managed to continue enjoying the support of the brass as well as the men in the ranks.
Roy Richter, president of the Captains Endowment Association, has called him a "solid guy."
"He'd be an excellent choice to be police commissioner," Lou Turco of the Lieutenants Benevolent Association said last month. "He's a cop's cop — 100 percent."
O'Neill, who has a bachelor's and master's degree from the John Jay College of Criminal Justice, was one of the first New York police commanders to put neighborhood policing into practice when he commanded the 44th Precinct, a tough chunk of the Bronx that includes Yankee Stadium. He has also commanded the 25th Precinct in East Harlem and the Central Park precinct.