Aaron Hernandez's murder conviction was reinstated Wednesday in a sweeping ruling from Massachusetts' highest court that does away with the legal principle that made the former NFL star innocent in the eyes of the law after he killed himself in prison.

The Supreme Judicial Court unanimously found that the legal rule that erased Hernandez's conviction is "outdated and no longer consonant with the circumstances of contemporary life." It ordered that Hernandez's conviction be restored and that the practice be abolished for future cases. The ruling does not affect past cases.

Hernandez was convicted in 2015 of killing semi-professional football player Odin Lloyd. Two years later, the 27-year-old killed himself in his prison cell days after being acquitted of most charges in a separate double-murder case.

A judge threw out Hernandez's conviction that year, citing the legal principle that holds that a defendant convicted at trial who dies before an appeal is heard should no longer be considered guilty in the eyes of the law, thereby returning the case to its pretrial status. The prosecution then appealed, seeking to have the conviction reinstated.

Under the doctrine, rooted in centuries of English law, a conviction should not be considered final until an appeal can determine whether mistakes were made that deprived the defendant of a fair trial, legal experts say.

How states handle cases such as Hernandez's varies widely. Some, like Massachusetts, toss the convictions, while other states dismiss the defendant's appeal and the conviction stands. Others allow appellate courts to consider a dead defendant's case, prosecutors said.

The district attorney whose office prosecuted Hernandez's case applauded the court's decision.

"We are pleased justice is served in this case, the antiquated practice of vacating a valid conviction is being eliminated and the victim's family can get the closure they deserve," Bristol County District Attorney Thomas M. Quinn III said in a tweet.

Hernandez's attorneys said they plan to ask the court to reconsider its decision, saying the court has "overlooked an essential point of fairness in applying its new rule to this case."

"The SJC did not state a cogent reason for applying this new rule to Mr. Hernandez's case, and there is no reason in the record that justifies that aspect of this decision," John Thompson and Linda Thompson said in a statement.

Prosecutors argued that the legal doctrine is outdated and unfair to victims. Quinn told the court that the defendant's estate should be allowed to appeal the case, if they wish. Otherwise, the conviction should stand, he argued.

Under the new rule laid out by the court, the conviction will stand, but the court record will note the conviction was neither affirmed nor reversed because the defendant died while the appeal was pending.

Lloyd's mother settled her wrongful death lawsuit with Hernandez's estate in September. A lawyer for Lloyd's family said Wednesday that they are pleased with the court's ruling.

"This decision has helped the family to obtain closure from the horrible loss of their beloved son Odin," Attorney Doug Sheff said in a statement. "He was an inspiration to all who knew him and a devoted member of his family and the community. It has solidified their faith in the Massachusetts Justice System."

Other high-profile Massachusetts criminals whose convictions have been erased after their deaths include John Salvi, who was convicted of killing two abortion clinic workers and wounding five other people during a shooting rampage in Brookline in 1994.

Roman Catholic priest John Geoghan, a key figure in the clergy sex abuse scandal that rocked the Boston archdiocese and spread across the globe, also had his child molestation conviction vacated after he was beaten to death in 2003 in his cell at the same Massachusetts maximum-security prison where Hernandez died.

___

Follow Alanna Durkin Richer at http://www.twitter.com/aedurkinricher