An appellate court in Missouri ruled Tuesday that a lower court was right when it decided to overturn the murder conviction of a woman who spent 43 years behind bars for a killing that her attorneys argue was committed by a discredited police officer.

Sandra Hemme was freed in July while the decision to overturn her conviction was reviewed -- at the insistence of Attorney General Andrew Bailey, who argued she should remain imprisoned.

Presiding Judge Cynthia Martin wrote in the scathing 71-page ruling that some arguments raised by Bailey's office bordered “on the absurd” and gave prosecutors 10 days to refile charges.

“It is time for this miscarriage of justice to end,” Hemme’s attorneys said in a statement following the ruling in the Missouri Court of Appeals Western District.

Hemme had been the longest-held wrongly incarcerated woman known in the U.S., according to her legal team at the Innocence Project.

A spokeswoman for Bailey didn’t immediately respond to an email from The Associated Press seeking comment.

Hemme was being treated with heavy doses of antipsychotic drugs when she was first questioned about the 1980 murder of 31-year-old library worker Patricia Jeschke in St. Joseph. One of Hemme's attorneys, Sean O'Brien, likened the drugs to a “chemical straightjacket” in an October hearing and said they raised questions about her ultimate confession.

“It makes her compliant,” he said. “It makes her subject to susceptibility.”

O'Brien also outlined evidence that was withheld that pointed to Michael Holman — a former police officer, who died in 2015. Evidence showed that Holman’s pickup truck was seen outside Jeschke’s apartment, that he tried to use her credit card, and that her earrings were found in his home.

The appellate court's ruling said the record “strongly suggests” that police buried their investigation into Holman.

The same conclusion was reached in June when Judge Ryan Horsman in Livingston County overturned her conviction. He found that Hemme's attorney had established “clear and convincing evidence” of “actual innocence."

But Bailey asked the appellate court to review that decision, arguing that Horsman had exceeded his authority and that Hemme failed to present sufficient evidence on some of her claims.

What ensued was a month-long fight over whether she should be freed while that review took place. A circuit judge, an appellate court and the Missouri Supreme Court all agreed Hemme should be released, but she was still held behind bars as Bailey argued that she still had time to serve on decades-old prison assault cases.

Hemme walked free only after Horsman threatened to hold the attorney general’s office in contempt.

At the latest hearing in October, Andrew Clarke, an assistant attorney general, faced tough questioning.

One of the appellate court judges noted particular concern about what happened when Holman, the discredited police officer, couldn’t be ruled out as the source of a palm print detected on a TV antenna cable found next to the victim’s body.

The FBI asked for clearer prints, but police didn’t follow up. Jurors never heard about that or other evidence because the police never informed prosecutors.

“The court," Clarke said in response to questions about the significance of suppressed evidence, "has to consider what its value is at a future trial, what it would look like. And if it undermines confidence in the prior verdict.”

Clarke contended that some of the evidence at issue might not have met the bar to be presented in court — a contention the judges questioned.

Bailey has a history of fighting overturned conviction cases. In July, a St. Louis circuit judge overturned Christopher Dunn’s murder conviction and ordered his immediate release. Among the key evidence used to convict him of first-degree murder was testimony from two boys who later recanted, saying they had been coerced by police and prosecutors.

Bailey appealed to try and keep Dunn locked up before he ultimately was released.