SANTA ANA, Calif. (CN) — A state judge will decide next week whether the worst mass murderer in the history of Orange County, California, must face the death penalty or can avoid it because of misconduct by the sheriff.

Scott DeKraai murdered his ex-wife and seven others at a Seal Beach hair salon in October 2011. He confessed almost immediately and pleaded guilty to murder in May 2014.

For the past three months, Orange County Superior Court Judge Thomas Goethals has been considering whether he should bar the death penalty in the case because the sheriff’s department violated DeKraai’s rights by intentionally and repeatedly hiding information about a secret program to use jailhouse informants against criminal defendants — including DeKraai.

The lead defense attorney, Assistant Public Defender Scott Sanders, argued Thursday that the sheriff’s department violated his client’s rights. “Removal of the death penalty is a measured response to incredibly egregious conduct,” he told Goethals.

Even at this late date, Sanders said, “All reason says that the sheriff’s department is holding back evidence that would be favorable to the defense in the penalty phase.”

Sanders laid bare the informant program in a 505-page motion he filed in January 2014. After two rounds of lengthy evidentiary hearings, he persuaded Goethals to remove the Orange County District Attorney’s Office as prosecutor in the DeKraai case.

As the informant scandal widened, sentences or convictions in at least six other Orange County murder or gang-related crimes were set aside. The Department of Justice, the California Attorney General’s Office, the district attorney’s office and the county grand jury all have investigated the snitch program.

In the just-concluded evidentiary hearing, which began in late May, Goethals has repeatedly demanded to know whether and how well the sheriff’s department has obeyed his orders to give the defense all relevant information about the informant program.

The sheriff’s department and the DA’s office initially denied any such informant program existed. But between the first set of evidentiary hearings and the second, “some witnesses completely changed their stories,” Goethals recalled Thursday.

Every year since 2013 new evidence about the program has turned up unexpectedly, according to Sanders, such as a detailed listing of inmate classifications and movements, called TRED records, showing how informants and suspects were placed together.

Last year, Sanders uncovered a separate sheriff’s department database about informants known as the “special handling log.”

And when this third evidentiary hearing began in May, the lieutenant newly in charge of the department’s revamped special handling unit disclosed for the first time that he had stumbled upon 68 banker’s boxes of files compiled by the unit on inmates it had monitored as far back as the early 1980s.

“I’m really concerned about whether all my lawful discovery orders have been complied with,” Goethals told Deputy Attorney General Michael T. Murphy, whose office took over the case when the district attorney was removed. “You’ve got a bad record. You’ve got bad facts here.”

Sanders argued vehemently on Thursday that sheriff’s officials constantly hid relevant information and lied on the stand.

“They’re committing a fraud on this court,” he said during about two hours of argument.

“One after another came in here and lied and lied and lied.”

Murphy, for the prosecution, seemed to acknowledge that officials had committed misconduct. But he said the only question before Goethals was whether that misconduct means DeKraai could not receive a fair trial if a jury were asked to decide whether he should be executed or sent to prison for life.

“The defense is not entitled to have a remedy just because misconduct might have occurred in this case,” unless it can prove prejudice, he said.

While the “minutia” Sanders cited about various informants and allegedly untruthful officials might be interesting and even important, and while the sheriff’s department gave up some discovery “begrudgingly” and late, “it doesn’t matter to the legal analysis if Mr. DeKraai can get a fair penalty phase trial,” Murphy said.

What does matter during the penalty phase, the prosecutor said, is DeKraai’s crime, his character and the views of his victims and their survivors.

The defense can present mitigation evidence that DeKraai has a good character or has done good things, Murphy said, but the idea that the jailers are hiding any such evidence is “just preposterous.”

“There’s no evidence the sheriff keeps records of good behavior,” he said. “If Mr. DeKraai saved someone’s life in jail, he knows about it.”

But Sanders said sheriff’s officials hid so much and lied so much that he had no way of knowing whether deputies had any records that could be used as mitigation, such as whether informants might have heard his client express remorse.

“They know what makes Scott DeKraai look more human,” he said. “They’re not going to give it to us.”

Sanders’ co-counsel, Senior Deputy Public Defender Sara W. Ross, arguing the legal issues, told Goethals the defense was not asking him to dismiss the death penalty or the special circumstances count from the case, only to exclude the death penalty as a sanction for discovery abuse.

“If we cannot trust the prosecution team to comply with discovery orders, if they come in and lie to this court … I don’t see how they can argue you can have confidence [enough to impose] the ultimate punishment,” she said.

Goethals asked if she’d ever seen a judge do what she was asking of him.

“No, but I’ve never seen a prosecution team do what they’ve done,” she replied.

Goethals judge said the question before him is more factual than legal. “The pivotal issue here is how do the facts play into the law,” he said.

“Do I believe based on the evidence I heard from both sides that my lawful discovery orders have been complied with? And if I don’t, do I believe the lack of fully complying implicated the right of the defendant to due process and a fair trial?”

Goethals gave both sides until next Wednesday to file final briefs. He said he would deliver his decision Friday morning, Aug. 18.