Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

In death, Aaron Hernandez is technically a free man.

A Massachusetts judge agreed Tuesday to erase the former NFL player's 2015 murder conviction after he killed himself last month.

Before his death, Hernandez was in the middle of an appeal review by the state Supreme Judicial Court. But his suicide essentially left his case unresolved — paving the way for a court to void his conviction entirely as part of a legal loophole known as "abatement ab initio," or "from the beginning."

The Commonwealth of Massachusetts tried to stop the move, but Judge E. Susan Garsh said the court "has no choice" but to comply with the law.

"The longstanding rule in Massachusetts is that if a defendant dies while his conviction is on direct appeal, the conviction is vacated and the indictment dismissed, thus abating the entire prosecution as if it never happened," Garsh said.

Hernandez, 27, was serving a life sentence for the 2013 murder of his friend, semipro football player Odin Lloyd. The New England Patriots dropped the promising tight end from its roster after his arrest.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The day before Hernandez hanged himself in his prison cell on April 19, inmates who knew him said he seemed to be "in a great place," according to a Massachusetts Department of Correction investigative report.

Five days before his death, Hernandez was acquitted of a double murder.

The report revealed that Hernandez may have been aware of the abatement process.

"Another source stated that Hernandez had recently mentioned a rumor," the report said. "This rumor was that if an inmate has an open appeal on his case and dies in prison, he is acquitted of his charge and will be deemed not guilty."

New England Patriots' Aaron Hernandez kneels on the field during football practice in Foxborough, Mass., on May 29, 2013. Michael Dwyer / AP file

A lawyer for the family of Lloyd said they would appeal the court's ruling to vacate Hernandez's murder conviction.

He pointed to Hernandez's remarks in the report, as well as a letter left to his fiancée before his death in which he cryptically wrote, "I told you what was coming indirectly!" and "(YOU'RE RICH)."

"He died a guilty man and convicted murderer," the lawyer said. "He should not be able to accomplish in death what he should have not accomplished in life."

Garsh, however, dismissed lawyers' assertions that the motive for why Hernandez took his own life is clear.

"The mere rumor of such a rumor is hardly sufficient to warrant the inference the commonwealth seeks to draw in respect to defendant's specific event," the judge said, adding, "A court should not have to conduct an exhaustive investigation in every case as to the circumstances of a defendant's death to determine if it was suicide, if defendant had capacity to make voluntary choice to live and factors that motivated him."

With the court's decision, Hernandez's estate could potentially be owed money from his Patriots contract that was never paid. Reports have suggested that amount could be around $6 million, accounting for his signing bonus and salary at the time of his arrest.

Another attorney for the Lloyd family, Douglas Sheff, asked the Patriots last month to voluntarily pay damages — potentially millions of dollars — as part of a wrongful death lawsuit brought against Hernandez before his death.

The Patriots have not commented on the issue.