LOS ANGELES – After falling just short of the number of votes needed to avoid a November runoff, Long Beach police Chief Jim McDonnell will have to hit the campaign trail again as he prepares to square off against former Undersheriff Paul Tanaka.

McDonnell was the only outsider among the seven candidates who battled to take on the tough task of overhauling the Los Angeles County Sheriff’s Department, which has been under fire over the management of the jail system — leading to federal indictments and the retirement of Sheriff Lee Baca.

At an election-night party Tuesday, McDonnell compared stepping into the role of sheriff to a corporate turnaround in which new management is recruited from outside the company.

“They don’t reach down into the organization to replace the CEO,” McDonnell told NBC4.

Assistant Sheriffs Todd Rogers and James Hellmold, LAPD Senior Detective Supervisor Lou Vince, retired sheriff’s Cmdr. Bob Olmsted and retired sheriff’s Lt. Patrick Gomez split the balance of the votes.

Baca, a four-term sheriff, retired in January while under fire for deputy-on-inmate violence in county jails and charges of corruption within his department. Eighteen sheriff’s deputies were indicted in an ongoing federal investigation that has implicated at least two additional deputies to date.

Baca’s surprise departure cleared the field for others, including McDonnell, a 29-year LAPD veteran who had earlier declined to face off against the incumbent.

“The Sheriff’s Department is at a defining moment in time and needs capable, new leadership to move it forward and rebuild fractured relationships with, and the confidence of, our community,” McDonnell said during his campaign.

McDonnell was endorsed by Los Angeles County District Attorney Jackie Lacey, LAPD Chief Charlie Beck, L.A. City Attorney Mike Feuer and California Attorney General Kamala Harris. He also has the backing of four of the five county supervisors who control the department’s budget: Michael Antonovich, Gloria Molina, Zev Yaroslavsky and Don Knabe, who appointed McDonnell to serve on the Citizens’ Commission on Jail Violence in 2011.

Tanaka, who is the mayor of Gardena, spent more than 30 years in the Sheriff’s Department and was second-in-command to Baca. He was blamed by the Citizens’ Commission in a 2012 report for promoting an environment in which aggressive deputies went undisciplined for violence against inmates.

Tanaka, who retired from his post in 2013, has called the commission’s findings an attack on his character and said its sources lied to prevent Tanaka from becoming sheriff. He, like all of the contenders, positioned himself as a reformer.

“I have never condoned nor encouraged excessive force or deputy misconduct. In fact, in the past I have been highlighted as a strict no- nonsense disciplinarian,” according to Tanaka. “Many of my accusers feared the standard of accountability they would be held to should I become sheriff.”

When a federal prosecutor confirmed in late May that Tanaka was the subject of an ongoing federal probe, some of his rivals called on him to step out of the race. Tanaka refused, saying he’d leave the choice to voters.

The former undersheriff outstripped other contenders in fundraising, with more than $900,000 in his war chest, according to the last available campaign filings.

Tanaka filed to run when Baca was still in office, giving him a head start in campaigning, and nearly half of his campaign cash was raised prior to this year. McDonnell bested Tanaka in 2014 contributions to date.

Interim Sheriff John Scott will head the department until December.