The murder conviction of Aaron Hernandez, shown in 2012, has been reinstated by the highest court in Massachusetts. (Elise Amendola/AP)

In a precedent-reversing decision, the highest court in Massachusetts ruled Wednesday that Aaron Hernandez’s first-degree murder conviction must be effectively reinstated even though Hernandez killed himself before his appeal could be heard.

Hernandez, a former New England Patriots tight end, was convicted in 2015 of the 2013 murder of Odin Lloyd. He was serving a life sentence without parole when officials say he hanged himself in his cell in the state’s maximum security facility in April 2017, days after his acquittal in a different double-murder trial.

The state’s Supreme Judicial Court declared the legal principle, based in English canonical law, that deems a conviction final only if a lower-court finding has been considered by an appeals court was outdated.

That doctrine of abatement ab initio (“from the beginning”) is “outdated and no longer consonant with the circumstances of contemporary life, if, in fact, it ever was,’’ associate justice Elspeth Cypher wrote in the opinion.

Under the court’s ruling, the Hernandez conviction will stand, with the court record noting that it was neither affirmed nor reversed because the defendant died while the appeal was pending.

“The practice of wiping out a jury verdict like it never occurred is not fair or equitable,’’ Bristol County District Attorney Thomas M. Quinn III said during oral arguments before the Supreme Judicial Court last fall. “Just to snap your finger and have that go away because the defendant died — it’s not fair.”

Quinn wrote Wednesday that, thanks to the court’s ruling, “justice is served."

“This decision acknowledged that there was no rational basis for continuing to follow this practice,” Quinn tweeted Wednesday, adding that the decision was based on common sense. “What he could not have accomplished in life he should not be able to attain in death.”

John H. Thompson, the court-appointed appellate lawyer for Hernandez, had argued that the criminal justice system is concerned solely with the defendant, not victims, their relatives or jurors.

Read more from The Post:

With Odell Beckham Jr. trade, the Browns just became Super Bowl contenders

The Jaguars could make Nick Foles a $100 million quarterback. Why? They were desperate.

Latest free agency news and rumors from around the NFL

College coaches took bribes to pass kids off as star athletes, FBI says. The NCAA is investigating.