A judge overturned the conviction of a Missouri woman who spent 43 years in prison after incriminating herself in a 1980 killing while she was a psychiatric patient, with the judge and the woman's lawyers suggesting a former police officer may have been the killer.

Judge Ryan Horsman ruled late Friday that Sandra Hemme, now 64, established evidence of actual innocence and must be released within 30 days unless prosecutors retry her in the case of 31-year-old library worker Patricia Jeschke's death. The judge said Hemme's trial counsel was ineffective and prosecutors did not reveal evidence that would have helped her defense.

Hemme's attorneys, who filed a motion seeking her immediate release, said this is the longest time a woman has been incarcerated for a wrongful conviction.

"We are grateful to the Court for acknowledging the grave injustice Ms. Hemme has endured for more than four decades," her attorneys said in a statement, pledging to continue in their efforts to dismiss the charges and allow Hemme to be reunited with her family.

JUDGE RULES MISSOURI ABORTION BAN DID NOT AIM TO IMPOSE LAWMAKERS' RELIGIOUS VIEWS ON OTHERS

Sandra Hemme

Sandra Hemme, now 64, spent 43 years in prison before a judge overturned her murder conviction. (Missouri Department of Corrections via AP)

Hemme was shackled in wrist restraints and so heavily sedated to the point that she "could not hold her head up straight" or "articulate anything beyond monosyllabic responses" when she was initially questioned about Jeschke's death, according to her lawyers.

The lawyers said in a petition seeking Hemme's exoneration that authorities ignored her "wildly contradictory" statements and suppressed evidence implicating then-police officer Michael Holman, who attempted to use Jeschke's credit card. Holman died in 2015.

The judge wrote that "no evidence whatsoever outside of Ms. Hemme's unreliable statements connects her to the crime."

"In contrast, this Court finds that the evidence directly ties Holman to this crime and murder scene," the judge wrote.

On Nov. 13, 1980, Jeschke missed work and her concerned mother climbed through a window in her apartment and discovered her nude body on the floor in a pool of blood. Jeschke's hands were tied behind her back with a telephone cord, a pair of pantyhose was wrapped around her throat and a knife was under her head.

Hemme was not being investigated in connection with the killing until she showed up nearly two weeks later at the home of a nurse who once treated her while she was carrying a knife and refused to leave.

Police located Hemme in a closet and transported her back to St. Joseph’s Hospital. She had been hospitalized several times starting when she began hearing voices at the age of 12.

Hemme had been discharged from that same hospital the day before Jeschke's body was found, and arrived at her parents' house later that night after hitchhiking more than 100 miles across the state. The timing seemed suspicious to law enforcement, and Hemme was subsequently questioned.

Hemme was being treated with antipsychotic drugs that had triggered involuntary muscle spasms when she was first questioned. She complained that her eyes were rolling back in her head, according to her lawyers' petition.

Detectives said Hemme appeared "mentally confused" and not fully able to understand their questions.

"Each time the police extracted a statement from Ms. Hemme it changed dramatically from the last, often incorporating explanations of facts the police had just recently uncovered," her attorneys wrote in the petition.

CONDEMNED MISSOURI INMATE IS 'ACCEPTING HIS FATE,' HIS SPIRITUAL ADVISER SAYS

Prisoner behind the jail cell bars

Sandra Hemme established evidence of actual innocence, a judge ruled. (iStock)

Hemme eventually purported that she witnessed a man named Joseph Wabski kill Jeschke.

Wabski, whom Hemme met when they both stayed in the state hospital's detoxification unit, was initially charged with capital murder before prosecutors quickly learned he was at an alcohol treatment center in Topeka, Kansas, at the time and dropped the charges against him.

After learning Wabski was not the killer, Hemme cried and claimed she was the killer.

Police were also starting to look at Holman as a suspect. About a month after the killing, Holman was arrested for falsely reporting his pickup truck was stolen and collecting an insurance payout. The same truck was seen near the crime scene and Holman's alibi, in which he claimed to have spent the night with a woman at a nearby motel, could not be confirmed.

Holman, who was ultimately fired and has since died, had also attempted to use Jeschke's credit card at a camera store in Kansas City, Missouri, on the same day her body was discovered. Holman claimed he found the credit card in a purse that had been left in a ditch.

During a search of Holman's home, police found a pair of gold horseshoe-shaped earrings in a closet, which Jeschke's father said he recognized as a pair he bought for her. Police also found jewelry stolen from another woman during a burglary earlier that year.

The four-day investigation into Holman then ended abruptly, and Hemme's attorneys said they were never provided many of the details uncovered.

Hemme wrote to her parents on Christmas Day in 1980, saying she might as well change her plea to guilty.

"Even though I’m innocent, they want to put someone away, so they can say the case is solved," Hemme wrote.

"Just let it end," she added. "I'm tired."

The following spring, Hemme agreed to plead guilty to capital murder in exchange for the death penalty being taken out of consideration.

Gavel

Sandra Hemme's attorneys filed a motion seeking her immediate release. (MediaNews Group/Boston Herald via Getty Images)

CLICK HERE TO GET THE FOX NEWS APP

But the judge initially rejected her guilty plea because she failed to share enough details about the incident.

Her attorney told her that her chance to avoid being sentenced to death relied on having the judge to accept her guilty plea. Following a recess and some coaching, she gave the judge more details.

The plea was later thrown out on appeal, but she was convicted again in 1985 after a one-day trial in which jurors were not provided details of what her current attorneys say were "grotesquely coercive" interrogations.

The system "failed her at every opportunity," Larry Harman said in her lawyers' petition. Harman, now a judge, previously helped Hemme have her initial guilty plea thrown out.

The Associated Press contributed to this report.