(CNN) Debra Milke spent 22 years on death row, convicted of conspiring with two other men to kill her son allegedly for an insurance payout.

On Monday, a judge ruled that the Arizona woman is innocent and dismissed all charges against her.

This makes Milke only the second woman exonerated from death row in the United States.

More importantly, the judge's decision finally clears Milke after years of legal back-and-forth in a case where she steadfastly maintained her innocence.

Key to the case's dismissal was prosecutorial misconduct, mainly that of a detective, Armando Saldate, who said Milke confessed to the crime to him -- even though there was no witness or recording.

Prosecutors withheld from the jury Saldate's personnel record which showed instances of misconduct in other cases, including lying under oath.

The two men with whom Milke was accused of conspiring were tried separately and are still on death row.

The killing

A day after seeing Santa Claus at a mall on December 1, 1989, young Christopher Milke asked his mother if he could go again.

Milke's roomate, James Styers, took the boy; then called Milke saying Christopher had disappeared.

Instead, Styers and a friend drove the boy out of town to a secluded ravine where Styers shot Christopher three times in the head, prosecutors said.

Styers and the friend were convicted of murder and sentenced to death.

Milke's 'role

Milke was implicated based on alleged testimony from Styer's friend, Roger Scott.

The detective, Saldate, said Scott told him that Milke was involved in a plot to kill her son. And during her trial, prosecutors floated a likely motive: A $5,000 life insurance policy she had taken out on the child.

But neither Scott nor Styers testified to a plot in court.

No other witnesses or direct evidence linked Milke to the crime other than Saldate's testimony.

Milke's 'confession'

Saldate further said that Milke confessed to her role in the murder plot during interrogation and said it was a "bad judgment call."

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.

Milke offered a vastly different view of the interrogation and denied that she had confessed to any role.

The trial became a he-said/she-said contest between the two.

Ultimately, the jury believed the detective and convicted Milke of murder.

Saldate's past

What prosecutors didn't tell the court was the detective's long history of lying under oath and misconduct.

Saldate had been suspended five days for taking "liberties" with a female motorist and lying about it to his supervisors. Four confessions or indictments had been tossed out because Saldate had lied under oath. Judges suppressed or vacated four other confessions because Saldate had violated a person's constitutional rights.

In 2013, after more than 20 years in jail, an appeals court overturned Milke's conviction.

"The Constitution requires a fair trial," Chief Judge Alex Kozinski of the federal 9th Circuit Court of Appeals wrote. "This never happened in Milke's case."

"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."

Milke was released on bail, and the court said she couldn't be tried again.

The state appealed the decision to the Arizona Supreme Court.

The ending

Last week, the Arizona Supreme Court refused to hear the appeal. And on Monday, all charges against Milke were finally dropped.

The ankle bracelet she had been wearing while on bail was removed. And Milke left the court room, sobbing in relief.

The case is now closed. Debra Milke is finally a free woman.