(AP) -- A Massachusetts judge has agreed to erase Aaron Hernandez's conviction in a 2013 murder because he died before his appeal could be heard.

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

The former New England Patriots tight end hanged himself in his prison cell last month while serving a life sentence in the killing of semi-professional football player Odin Lloyd.

Prosecutors argued that dismissing his murder conviction would reward Hernandez's decision to take his own life.