Updated

A state appeals court has ordered the dismissal of murder charges against a woman who spent 22 years on Arizona's death row for the killing of her 4-year-old son.

The Arizona Court of Appeals on Thursday leveled harsh criticism against prosecutors over their failure to turn over evidence during Debra Jean Milke's trial about a detective with a long history of misconduct and lying. The court called prosecutors' actions "a severe stain on the Arizona justice system."

A three-judge panel of the appeals court said it agreed with Milke's argument that a retrial would amount to double jeopardy.

The failure to disclose the evidence "calls into question the integrity of the system and was highly prejudicial to Milke," the court wrote. "In these circumstances -- which will hopefully remain unique in the history of Arizona law -- the most potent constitutional remedy is required."

The court said the charges against Milke in the 1989 death of her son Christopher can't be refiled, but prosecutors could appeal Thursday's ruling to the state Supreme Court.

Authorities say Milke dressed her son in his favorite outfit and told him he was going to see Santa Claus at a mall in December 1989. He was then taken into the desert near Phoenix by two men and shot in the back of the head.

Authorities say Milke's motive was that she didn't want the child anymore and didn't want him to live with his father.

She was convicted in 1990 and sentenced to death. The case rested largely on her purported confession to Phoenix police Detective Armando Saldate, which he did not record.

Milke, 50, was on death row for two decades, and the Arizona Supreme Court had gone so far as to issue a death warrant for Milke in 1997. The execution was delayed because she had yet to exhaust federal appeals.

The appeals court said Thursday it wasn't expressing an opinion on Milke's guilt or innocence, though it heavily criticized authorities for staking much of their case on a detective with credibility problems.

A federal appeals court threw out Milke's first-degree murder conviction in March 2013, saying prosecutors knew about a history of misconduct by the detective but failed to disclose it. Maricopa County prosecutors were preparing for a retrial.

Lori Voepel, Milke's appellate attorney, was ecstatic at Thursday's victory.

Milke has been free on bail since September 2013 as she awaited retrial.

"This is really a sock in the gut -- it's a cheap shot," said Arizona Milke, Christopher's father and Debra Milke's ex-husband. "She shouldn't walk free, because she's guilty."

Maricopa County Attorney Bill Montgomery, whose office is handling the case, said he plans to ask the Arizona Supreme Court to overturn Thursday's ruling.

Montgomery said the accusations of misconduct happened well before he took over as the county's top prosecutor and would not happen today, citing safeguards such as having detectives record interviews with suspects.

Montgomery also said he would not be pursuing the case if he believed the evidence could not lead to a conviction in Christopher's killing.

"He should not be forgotten in all of this. Justice and due process for Christopher is a right that he has, too," Montgomery said. "And it's the job of prosecutors, unfortunately in situations like this, where we have to be the voice of the voiceless."

Milke has maintained her innocence and denied she ever confessed to the killing. The two men who led her child to his death in the desert were convicted of murder but refused to testify against Milke.

That left jurors with Saldate's word alone that she told him about her involvement. Saldate has since retired, and The Associated Press has made repeated efforts to reach him for comment.

In its ruling overturning Milke's conviction, the 9th U.S. Circuit Court of Appeals cited numerous instances in which Saldate committed misconduct in previous cases, including lying under oath and violating suspects' rights. The federal appeals court also asked the Justice Department to investigate whether Saldate had committed civil rights violations.

Prosecutors insist Milke is guilty, but their ability to try her again was limited by the fact that Saldate said he wouldn't testify. He fears potential federal charges based on the 9th Circuit's accusations of misconduct.

In December, Superior Court Judge Rosa Mroz granted Saldate's request to assert his Fifth Amendment right, allowing him to refuse to take the stand.

The state Court of Appeals overturned that ruling in April and said Saldate would be forced to testify at the retrial. Both county and federal authorities said they don't intend to seek charges against the detective based on any of the accusations leveled by the federal appeals court.

Milke, whose mother was a German who married a U.S. Air Force military policeman in Berlin in the 1960s, has drawn strong support from citizens of that nation and Switzerland, neither of which has the death penalty.

Milke's mother died in Germany this year after a battle with cancer. A week before the August death, a judge had denied Milke's request for permission to travel to Germany to visit her mother.