BILLINGS, Mont. -- A Montana man pleaded guilty Tuesday to a pair of crimes that remained unsolved for two decades -- the brutal murder of an 18-year-old video store clerk and the rape and attempted murder of a newspaper carrier.

Zachary David O'Neill, 39, entered his guilty pleas in state district court after he was charged with deliberate homicide in the killing of Miranda Fenner at a Laurel video store in November 1998.

Fenner's throat was slashed and she was repeatedly stabbed.

O'Neill told investigators that he'd gone to the store to rob it and decided to kill Fenner after he thought she recognized him, according to an affidavit from law enforcement.

"That's when I pulled out this knife I had," O'Neill said. "I tried to slit her throat, but it was too jagged. I could hear her gurgling on her own blood."

Fenner was found alive, but died hours later at a Billings hospital. O'Neill was 18 at the time and had recently moved from Spokane, Washington to live with his stepfather in Laurel.

He told investigators that he had been committing thefts and burglaries to support a drug habit that included methamphetamine, which he smoked earlier in the day before killing Fenner.

O'Neill also pleaded guilty Tuesday to the rape and attempted murder of a newspaper carrier in September 1998. In that case, too, the victim's throat was slit. O'Neill said he had tried to kill the woman to avoid being caught for the rape.

A plea agreement between the defence and prosecutors recommends he be sentenced to life in prison.

Fenner's slaying drew national attention, but grew to frustrate investigators who stuck with the case despite years without a breakthrough, Yellowstone County Sheriff Mike Linder said.

Over the years, Linder said, others falsely claimed responsibility for the slaying. But only O'Neill, 39, offered details that corroborated his involvement, during a 2017 interview after he attempted to turn himself in at the county jail, said Detective Frank Fritz.

"Many people had tried to point fingers at other people," said his defence attorney, Kris Copenhaver. "Others had come forward and said to differing degrees, 'I'm it."'

Copenhaver declined further comment until after a sentencing hearing scheduled for Aug. 23 before state District Judge Jessica Fehr in Billings.

Because of the confessions by others, O'Neill was not immediately arrested after the 2017 interview, Linder said. The suspect later travelled to Spokane, Washington, where he was arrested on an unrelated charge. He was recently sent back to Montana to face charges in the two Billings cases.

Fenner's family requested privacy in a statement shared by Linder's office.

"We are relieved that there is an end in sight for the nightmare that has caused so much heartache and pain to everyone who knew and loved Miranda," the statement said. "Nothing will bring Miranda back and we can only pray that other families may be spared the grief that this type of crime inflicts."

Asked by investigators why he stepped forward after so many years, O'Neill said he didn't care much about the crimes when they occurred but later felt "ashamed" and regretted his actions. DNA found at the scene of the attack on the newspaper carrier matched DNA taken from O'Neill in 2017.

O'Neill has also confessed to a third crime, the rape of a woman at a park along the Yellowstone River, also in September 1998, according to court documents. The victim in that case died in 2013, but DNA evidence from the scene matched O'Neill's, according to court documents.

He was not charged with the crime under the terms of his plea deal.