Jerry Hartfield, 59, has been in prison since 1977 even though his original murder conviction was overturned in 1980. On Wednesday, a Texas jury found him guilty of the crime for a second time.

In 1977, a jury convicted Hartfield, who is black, of the 1976 rape and murder of Eunice Lowe, a white 55-year-old bus-station ticket agent in Bay City, Texas. Three years later, Texas’s highest criminal appeals court overturned the conviction, citing jury selection issues, and ordered a retrial—an order the prosecution fought for years. Before that retrial began, however, then-Texas Governor Mark White commuted Hartfield’s death sentence to life imprisonment in 1983.

There was only one catch: Because Hartfield’s original conviction had been vacated, he legally had no death sentence for the governor to commute. But since no one realized this at the time, or for decades afterward, Hartfield stayed in prison and served the commuted life sentence without retrial. My colleague Andrew Cohen described how every part of the criminal-justice system failed Hartfield when he wrote about the case in 2013:

Texas prosecutors thought that the governor's commutation resolved the issue, at least until someone challenged the commutation for failing to supersede the mandate of reversal. The state judges in 1983 reckoned that the mandate had been issued, and that if the case weren't properly resolved they would soon hear about it from prosecutors or defense counsel. And Hartfield's lawyer says that he stopped representing his client when the commutation came through. Everyone dropped the ball on Hartfield, who after 32 years in prison still has never received a parole hearing even though he's long been entitled to one.

Hartfield, who reportedly has an IQ of 51, did not realize he was serving a life sentence until a jailhouse lawyer discovered the error in 2006. When Hartfield petitioned for release that year, prosecutors fought it, and state courts refused his request. But in June 2013, the Texas Court of Criminal Appeals ruled that Hartfield was indeed in prison without a sentence. Prosecutors then announced their intention to retry him—more than three decades after his original sentence was tossed out—and kept him in prison until then.