Convicted murderer Aaron Hernandez died an innocent man, thanks to an obscure legal rule that waives his conviction posthumously.

The New England Patriots might have to pay Hernandez’s estate a $3.5 million bonus and an additional $2.5 million in guaranteed money that was not paid to him after his arrest in 2013.

The money will likely go to his fiancée, Shayanna Jenkins, and their 4-year-old daughter, Avielle Hernandez.

Hernandez was serving a life sentence in the shooting death of semi-pro football player Odin Lloyd, who was dating the sister of Hernandez’s fiancée.

Under an obscure Massachusetts doctrine, the state must throw out the conviction for a felon who dies before his appeal can be heard.

Legally, it is as if Hernandez was never convicted.

Hernandez was found hanged in his cell early Wednesday — less than a week after a jury acquitted him in the shooting deaths of 2 men in Boston in 2012.

Hernandez reportedly scrawled “JOHN 3:16” on his forehead in his own blood before hanging himself with a bed sheet.

If the Patriots pay Hernandez’s estate the millions he is owed, the families of Lloyd, Safiro Furtado and Daniel DeAbreu (the Boston victims), are waiting in line for their cut.

Hernandez’s attorney said his brain will be donated to CTE research.

Photo by Win MacNamee/Getty Images