Judge Thomas M. Goethals ruled Thursday that the case will be handled by the state attorney general's office.
Goethals said "false and or intentionally misleading testimony" was presented and the district attorney's office is "legally responsible" for the acts of its agents.
Dekraai pleaded guilty to killing his ex-wife and seven others in a shooting rampage at a hair salon in Seal Beach on Oct. 12, 2011. The tragic attack is considered the worst mass shooting in Orange County history.
Goethals' decision drew disbelief and outrage from the families of the eight victims.
"The worst possible thing he could have done to the families was to extend this for another year before we get to trial," said Bethanny Web, sister of one of the victims.
Dekraai opened fire at Salon Meritage in the 500 block of Pacific Coast Highway, killing the salon's owner, his ex-wife Michelle Fournier and five other people. Police say Fournier, an employee at the salon, was the intended target. Dekraai and Fournier were allegedly involved in a bitter custody battle over their 8-year-old son.
After the shooting inside the salon, police say Dekraai walked out and shot a man sitting in a car in the parking lot before fleeing in his white pick-up truck. He was later arrested by police about a half-mile from the scene.
The victims' families say they're disappointed the case is about anything but the lives Dekraai took.
"The jailhouse informants, talking to somebody, the evidence the sheriff's withheld, or did not withhold, who cares?" said Paul Wilson, who lost his wife.
Thursday's ruling followed a yearlong courtroom duel over allegations that authorities misused jailhouse informants, hid evidence and lied on the witness stand during Dekraai's case.
Dekraai's lawyer, Scott Sanders, argued that his client's rights had been violated by the use of a jailhouse informant. After months of testimony, Goethals ruled that prosecutors could not use damning statements Dekraai made to the informant.
The defense also alleged that some law enforcement officials lied under oath during previous hearings regarding how the informant ended up being placed next to Dekraai's cell.
"The willingness to endorse the brazenly false testimony of witnesses because it is perceived as helping to secure a penalty phase trial demonstrates a conflict," Sanders wrote in a brief filed ahead of Thursday's hearing.
The defense also asked Goethals to take the death penalty off the table, but that request was denied.
The judge stayed the order to allow time for an appeal.
"We respectfully disagree with the ruling. We are exploring appellate options," said Assistant District Attorney Dan Wagner.
The district attorney has until March 20, the date set for the pretrial, to file an appeal.
The Associated Press contributed to this report.