Aaron Hernandez's murder conviction was reinstated Wednesday by the Massachusetts Supreme Judicial Court -- nearly two years after the ex-NFL star was found dead in his prison cell, sparking a lengthy legal battle as to the official status of his guilt.

Hernandez was found guilty in 2015 of the killing of Odin L. Lloyd but, two years later, the former New England Patriots tight end was found hanging from a bedsheet attached to a window in his cell.

AARON HERNANDEZ'S ATTORNEY SAYS IN NEW DOCU-SERIES EX-NFL PLAYER'S 'FINAL DAYS WERE HAPPY DAYS'

He had been serving life without parole for the murder and had been acquitted of committing a double murder in 2012.

The judge threw out Hernandez’s conviction in the Lloyd killing after his death, citing a rule that states a defendant convicted at a trial who dies before they have a chance to have their appeal heard should not be considered guilty and, therefore, returns the person to their pretrial status, according to NECN.

Prosecutors had argued the legal principle was unfair to victims and was outdated.

The Supreme Judicial Court on Wednesday, however, decided the conviction will stand -- but added the court record will note the conviction was neither affirmed nor reversed because the defendant died during the appeal process.

In three seasons with the Patriots, Hernandez joined Rob Gronkowski to form one of the most potent tight end duos in NFL history. In 2011, his second season, Hernandez caught 79 passes for 910 yards and seven touchdowns to help the team reach the Super Bowl, and he was rewarded with a $40 million contract.

But the Patriots released him in 2013, shortly after he was arrested in the killing of Lloyd, who was dating the sister of Hernandez's fiancée.

CLICK HERE TO GET THE FOX NEWS APP

A week before his suicide, Hernandez was acquitted in the 2012 drive-by shootings of two men in Boston. Prosecutors had argued that Hernandez gunned the two men down after one accidentally spilled a drink on him in a nightclub.

Fox News’ Samuel Chamberlain and the Associated Press contributed to this report.