A judge has agreed to erase Aaron Hernandez's conviction in a 2013 murder case because he died before his appeal was heard.

Judge E. Susan Garsh ruled Tuesday that a legal doctrine that calls for vacating convictions when a defendant dies before the appeal was binding precedent. She said she was compelled to follow it.

Bristol County District Attorney Thomas M. Quinn III said he plans to appeal the ruling and is willing to take the case all the way to the Massachusetts Supreme Court.

"Despite the tragic ending to Aaron Hernandez's life, he should not reap the legal benefits of an antiquated rule," Quinn said. "State and federal courts from across the country have rejected this antiquated rule. Massachusetts, in my opinion, needs to follow suit."

A lawyer for Hernandez's estate had asked the judge to overturn the conviction after the former New England Patriots tight end hanged himself in his prison cell last month. He was serving a life sentence in the killing of semiprofessional football player Odin Lloyd.

Appellate attorney John Thompson maintained that a conviction is not considered final until it is decided by a higher court.

Ursula Ward, Lloyd's mother, said the judge's decision will not affect her view on Hernandez's culpability and what happened to her son.

"In our book, he's guilty and he's going to always be guilty," Ward said of Hernandez. "But I know, I know one day I'm going to see my son, and that's the victory that I have and I am going to take with me. I am waiting for my master to say, 'Well done, my good and faithful servant, and welcome to the joys of my kingdom.' And that's when I'll see my baby again. ...

"I am not giving up. When [God] says the battle is over, the battle is over. So I'm holding on until He tells me to give up."

Lloyd's family could still proceed with a wrongful death lawsuit against Hernandez's estate, despite the ruling.

Prosecutors had said that dismissing the murder conviction would reward Hernandez's decision to take his own life. Prosecutor Patrick Bomberg had argued that Hernandez "should not be able to accomplish in death what he could not accomplish in life."

Garsh rejected the argument that Hernandez had forfeited his right to appeal by taking his own life, saying no one can ever know for sure why Hernandez killed himself.

Following Garsh's ruling, Thompson told reporters he still has doubts about whether Hernandez did kill himself. He also raised a question about the official manner of death during Tuesday's court hearing.

Thompson said he had recent correspondence from Hernandez in which he said he was interested in pursuing an appeal.?The attorney also said because Hernandez died in prison, it will be difficult to definitively determine how he died.

Hernandez died five days after being acquitted in a separate double slaying in 2012. The lead attorney in the double murder trial, Jose Baez, has pledged to do an independent investigation into Hernandez's death.

State police said in an investigative report that Hernandez was found naked on April 19 and hanging from a bed sheet tied around the window bars of his cell. Correction officers found that cardboard had been shoved into the tracks of Hernandez's cell door to prevent the door from opening. Hernandez also had put shampoo on the floor to make it slippery, the report states.

An autopsy performed by the state medical examiner's office determined the cause of Hernandez's death was asphyxia by hanging and the manner of death was suicide.

Hernandez, who grew up in Bristol, Connecticut, and played football at Florida, was considered an up-and-coming star during his three seasons with the Patriots. He was cut from the team hours after his arrest in the killing of Lloyd.

The Associated Press contributed to this report.