(CNN) -- After 22 years on death row, Debra Milke is close to freedom.
A jury convicted the Arizona woman, now 49, of murder, conspiracy to commit murder, child abuse and kidnapping on October 12, 1990, less than a year after her 4-year-old son was found dead.
A judge sentenced her to death a few months later.
But those convictions and the related sentence were tossed out Thursday by a federal appeals court judge. In explaining his decision, Chief Judge Alex Kozinski of the federal 9th Circuit Court of Appeals chided the prosecution for remaining "unconstitutionally silent" on the "history of misconduct" of its key witness, a Phoenix police detective.
"The Constitution requires a fair trial," Kozinski wrote. "This never happened in Milke's case."
A day after seeing Santa Claus at a mall, young Christopher Milke asked his mother if he could go again. That was the plan, she said, when the boy got into the car with Milke's roommate, James Styers.
Styers picked up a friend, "but instead of heading to the mall, the two men drove the boy out of town to a secluded ravine, where Styers shot Christoper three times in the head," according to Kozinski's summary of the case. Styers was convicted of first-degree murder in the boy's killing and sentenced to death.
The detective, Armando Saldate, said the friend told him that Debra Milke was involved in a plot to kill her son. But neither the friend nor Styers testified to that assertion in court.
In fact, "no other witnesses or direct evidence (linked) Milke to the crime" other than Saldate's testimony. After pleading not guilty, Milke stood trial and tried to convince a jury that her account -- and not the detective's -- was the true one.
"The trial was, essentially, a swearing contest between Milke and ... Saldate," said Kozinski.
The detective testified he "didn't buy" Milke's reaction after he informed her that her son was dead. After that, Saldate said he placed Milke under arrest. In a subsequent interrogation, she confessed that her role in the murder conspiracy was a "bad judgment call," the detective said.
But Milke offered a vastly different view of the interrogation and denied that she had confessed to any role in a murder plot.
There was no recording of the interrogation, no one else was in the room or watching from a two-way mirror, and Saldate said he threw away his notes shortly after completing his report.
"The judge and jury believed Saldate," said Kozinski of the verdict and sentence. "But they didn't know about Saldate's long history of lying under oath and other misconduct."
Specifically, the judge noted that the detective had been suspended five days for taking "liberties" with a female motorist and lying about it to his supervisors; that judges had tossed out four confessions or indictments because Saldate had lied under oath; and that judges suppressed or vacated four confessions because Saldate had violated a person's constitutional rights.
"The state knew of the evidence in the personnel file and had an obligation to produce the documents," Kozinski said. "... There can be no doubt that the state failed in its constitutional obligation."
The judge ordered "the state" to turn over Saldate's personnel records to Milke's lawyers, after which "a police official" must state under oath that everything has been disclosed and nothing has been "omitted, lost or destroyed."
Once this is done, a district court must order Milke's release unless prosecutors tell the court within 30 days that they plan to retry her soon.
"In the balance hangs the life of Milke," Kozinski said, explaining the importance of his decision to overturn her convictions.