An 81-year-old man has been freed after more than four decades in prison, his sentence for murder erased in the case of a 1970s gas station robbery.

Charles Ray Finch went home from Greene Correctional Institution Thursday after U.S. District Judge Terrence Boyle vacated his sentence, backing a January decision by a federal appeals court that ruled a police lineup that had identified him was “impermissably suggestive.” Finch has long maintained his innocence.

In 1976, a Wilson County jury convicted Finch of shooting a gas station owner in a robbery in rural Black Creek, connecting him to an eyewitness description of a shotgun-wielding assailant wearing a long coat and hat.

Finch’s freedom comes after nearly two decades of work by Duke University’s Wrongful Convictions Clinic, which first interviewed Finch in 2001 and retraced much of the evidence. Most importantly, it discovered that Finch was the only suspect shown in a lineup wearing a hat, which matched a description of the robber from the scene.

“The totality of the evidence would prevent any reasonable juror from finding him guilty beyond a reasonable doubt,” the appeals court wrote in January, “such that his incarceration is a miscarriage of justice.”

At the time, prosecutors offered one eyewitness, Lester Floyd Jones, as the “bedrock” of their case. Jones worked with Richard Linwood Holloman at the gas and grocery. In its January ruling, the appeals court noted testimony that Jones “had cognitive issues, struggled with alcoholism and had issues with short-term memory recall.”

Jones testified in 1976 that he and Holloman were closing up the store when three black men came toward the station from the highway, one of them staying back out of the light. The man Jones later identified as Finch wore a three-quarter length coat and a woman’s light-colored stocking on his head.

A second man in a checkered shirt and red toboggan asked to buy some Alka-Seltzer, Jones testified, and when Holloman went to get it, Finch said, “And your money, too.”

Jones testified that Finch then pulled a sawed-off shotgun from under his coat and shot at Holloman, who had been holding a revolver and returned fire. Jones added that he dove under a counter after the first shot and identified the gun by its sound.

A second witness, Noble Harris, told police he had bought a beer and a quart of wine at the gas station on the night of Holloman’s murder and saw Finch there getting out of a blue Cadillac. In 2003, the court’s ruling said, Harris said he later had doubts about the brief meeting and told Chief Deputy Tony Owens about his misgivings.

“Harris recounted in his affidavit that Deputy Owens and the prosecutor pressured him into sticking to his original story,” the ruling said.

Later on the night of the shooting, court documents said, officers in Wilson caught Finch in his blue Cadillac. Finch agreed to a search, and officers found a shotgun shell in the ash tray of the rear door. Later, Finch’s son would testify that he had found the shell while cleaning the Cadillac, a used model bought four months before, and put it in the glove compartment.

After Finch’s arrest, the ruling said, officers placed him in a series of three lineups in the Wilson County jail, using seven black men in casual clothes. Jones picked Finch all three times.

But while Owens said he placed Finch’s hat and coat on another man, the record shows differently, the judges’ opinion said. Finch wore a three-quarter length coat in all three of the lineups, and in one of them, he was the only man wearing a hat.

“We had a picture of the lineup,” said James Coleman, Duke law professor and the clinic’s co-director, in January, “and Ray Finch wore a coat in every one of them.”

Three witnesses appeared for Finch during his 1976 trial, all of whom said he could not have killed the gas station owner because he was playing poker at Tom Smith’s Shoeshine Stand at the time of the shooting, court records said. In their ruling, the judges wrote that these alibi witnesses “would seem more credible.”