LOS ANGELES ― Tony Rackauckas, the Orange County district attorney whose office has been plagued by allegations of corruption in a yearslong jailhouse informant scandal, will face a run-off election in November for the job of top prosecutor in the Southern California county.

On Tuesday, Rackauckas won more votes than each of his three opponents ― his former protégé County Supervisor Todd Spitzer, former Brea Mayor Brett Murdock and consumer attorney Lenore Albert-Sheridan ― but failed to capture a majority. The district attorney ended ahead of the second-place vote-getter, Spitzer, by a narrow 4 percent margin.

As a result, Rackauckas and Spitzer, both Republicans, will battle it out again in the fall.

In California, a county district attorney candidate who finishes with a majority of votes in the primary election has won the job. But if no candidate gets better than 50 percent, then the top two vote-getters face off in the November general election.

Rackauckas, who first took office in 1999 and is seeking his sixth term, was endorsed by four members of Congress, two state senators and multiple state assemblymen, all Republicans. He was also endorsed by Orange County Sheriff Sandra Hutchens, who has faced scathing criticism for her agency’s role in the informant scandal.

Spitzer had once been groomed by Rackauckas to be the future leader of the DA’s office. Then he was fired in 2010, shortly after being accused of seeking information about a case that was beyond his authority. Spitzer claims he was really fired for political reasons and pledged during the campaign to clean up the DA’s office. But he has faced criticism himself for handcuffing an unarmed man at a Wahoo’s Fish Taco restaurant in 2015.

The Orange County District Attorney’s office has been in crisis for years.

In 2014, Assistant Public Defender Scott Sanders alleged that prosecutors and law enforcement officers in Orange County had for decades been running an illegal jailhouse informant program that violated inmates’ rights ― including those of his client, Scott Dekraai, a tugboat captain who had killed eight people at a Seal Beach salon.

Sanders contended that in multiple cases, the district attorney’s office and the sheriff’s department colluded to plant informants inside county jail cells in order to obtain damning information from defendants who were awaiting trial and represented by lawyers ― a violation of an inmate’s right to counsel. According to Sanders, prosecutors then presented that damning evidence in court, while withholding evidence that could have been beneficial to the defense — a violation of a defendant’s right to due process.

In 2015, then-Superior Court Judge Thomas Goethals barred Rackauckas’ entire office from further prosecuting the Dekraai case due to “ongoing prosecutorial misconduct.” Goethals acknowledged there was no direct evidence that Rackauckas had actively participated in the concealment of evidence by sheriff’s deputies, but the judge faulted the prosecutor for “chronic failure” to comply with court orders to produce evidence.

Rackauckas has maintained that none of his prosecutors intentionally behaved inappropriately, accused Goethals of bias and claimed the media have exaggerated the magnitude of the informant scandal.

The scandal has already led to the unraveling of nearly 20 cases in Orange County and threatens still more. The U.S. Department of Justice, the California attorney general’s office and an Orange County grand jury all launched probes into the allegations of misconduct.

Last year, the grand jury produced a controversial report on its findings, based almost entirely on interviews with prosecutors and sheriff’s staff. The grand jury called the scandal a “myth” perpetuated by the media and a “witch hunt.” Its report was blasted by legal experts who said an outside, truly independent investigation was needed.

The Justice Department’s and California attorney general’s investigations are ongoing. No charges have been filed against any government official accused of wrongdoing linked to the jail informant program.