A judge on Tuesday erased former NFL star Aaron Hernandez’s conviction in a 2013 murder because Hernandez died before his appeal was heard, but the district attorney plans to file an appeal.

Hernandez, who had been a standout tight end for the New England Patriots before his arrest, hanged himself in his jail cell on April 19. He was serving a life sentence in the killing of semi-professional football player Odin Lloyd, and his suicide came just five days after he was acquitted in a different double slaying in 2012.

Hernandez's appellate attorneys made their request under a long-standing legal principle holding that when defendants die before their direct appeal is decided, their convictions are vacated. Prosecutors argued that dismissing Hernandez’s murder conviction would reward his decision to take his own life.

"Despite the tragic ending to Aaron Hernandez's life, he should not reap the legal benefits of an antiquated rule," said Bristol County District Attorney Thomas M. Quinn III in a statement, noting that several state and federal courts have rejected legal principle upon which Hernandez's attorneys made the request.

Quinn's statement continuted: "These courts have found that when a defendant commits suicide, and I quote, "he deprives himself of a final determination of his case's merits. Justice does not require abatement of a conviction when the defendant himself prevents a review of the merits."

A federal court likewise concluded that, quote, ""it defies common sense to allow a defendant to be absolved of criminal liability so carefully arrived at by a jury because he intentionally took his own life before the appeal process could run. By his suicide, the defendant waives his right to appeal."

Judge Susan Garsh, who presided at Hernandez's trial in Lloyd's killing, heard the appeal on Tuesday.

Garsh said there was no reason to go against the legal principle in Massachusetts, known as "abatement an initio," where a conviction is overturned if a defendant dies while the case is under appeal. She said the court can not know why Hernandez ended his life, and, while there were many rumors as to why, including the prosecution's argument that it was to get an abatement, she could not infer that.

Fox News' Jennifer Oliva and The Associated Press contributed to this report.