Michael Dorman of Mebane was accused of the murder of 31-year-old Lakeia Boxley. Boxley disappeared from her Durham apartment in March 2008.
Prosecutors said after the killing, Dorman carried Boxley's bones around in a backpack. Dorman told investigators when he was arrested in 2010 that he simply found Boxley's remains.
On Friday, Dorman entered an Alford Plea to voluntary manslaughter.
He read a written statement in court that said in part, "I'm pleading guilty not out of guilt, but out of fear that I won't get a fair trial."
An Alford plea means he does not admit guilt, but acknowledges the evidence against him could lead to a guilty verdict.
The case has been caught up in red tape for nearly three years.
Earlier this year, a trial date was set after the North Carolina Court of Appeals ruled Dorman should face trial. Judge Orlando Hudson had orginally dismissed the case after ruling that prosecutors had destroyed evidence without allowing the defense to review it.
Boxley's family had her bones cremated after they were released by the medical examiner's office.
In 2011, former Durham County District Attorney Tracey Cline argued that the cremation was not a reason to allow a suspected killer to walk free. Cline also said at the time that a portion of Boxley's skull was saved and was available for DNA testing.
Investigators and medical examiners called by the state later testified that there was no plot to destroy evidence.
Dorman has been behind bars since his arrest, despite a judge lowering his bond to $150,000 last year.
Members of Boxley family were in the courtroom for the sentencing hearing Friday carrying the urn filled with her remains.
The judge sentenced Dorman to serve 61 to 83 months in prison. He will be credited 1,107 days for time already served - meaning he'll be free in 2-5 years.
In addition to prison time, Dorman will receive another mental health evaluation and treatment at a state hospital.