It’s always a little weird when people say they’ve just seen your doppelgänger. Often, it’s a benign coincidence. For Michael McAlister, the coincidence turned ugly in 1986, when he was mistaken for a man who assaulted a 22-year-old woman in the laundry room of an apartment complex in Richmond, Virginia. During the attack, the victim was able to see part of the masked face of a tall blond man wearing a plaid shirt. She picked McAlister out of a police lineup and also identified him in court. McAllister, then a 29-year-old living with his mother, was convicted. He spent nearly three decades in prison.

For years, McAlister and a range of other people insisted that he was innocent. Even law enforcement authorities, including police detectives and the original prosecutor, agreed. Norman Bruce Derr, who resembles McAlister, eventually confessed to the 1986 attack in exchange for immunity from prosecution in the case, The Washington Post reports. Finally, on Wednesday, Virginia Gov. Terry McAuliffe pardoned McAlister.

McAlister’s criminal record—which included two drunken indecent exposure incidents—contributed to investigators’ decision to put him in the photo lineup, in which he was asked to wear a plaid shirt like that of the victim’s attacker. But McAlister was convicted mainly because of the victim’s misidentification—the only piece of evidence submitted at trial. Police affidavits later revealed that Derr was being trailed by law enforcement for attacking women—including a female undercover police officer—in Richmond apartment complex laundry rooms before McAlister’s conviction.

“Bureaucracy and haste were responsible for the fact that in the moment the cops failed to draw the obvious conclusions,” wrote Dahlia Lithwick of the wrongful conviction for Slate. Derr is serving five life sentences in Virginia for additional rape convictions.

Eyewitnesses incorrectly identify suspects more frequently than you might think. According to the Innocence Project, an exoneration advocacy group, this kind of evidentiary error is the greatest contributing factor to wrongful convictions in the U.S. Eyewitness misidentifications contribute to nearly 75 percent of convictions that are later overturned by DNA evidence. The stress and trauma experienced by victims can sometimes inhibit their ability to correctly identify an alleged perpetrator. Also, investigators preparing lineups or photo arrays can unintentionally sway an identification one way or another. For example, if the officer administering a lineup knows who the suspect is, he or she may offer subtle cues to the person making the identification that influence the outcome.

“The integrity of our justice system depends on the guarantee of a fair trial that is informed by all available evidence,” McAuliffe said in a statement issued after McAlister’s pardon. “Protecting that integrity requires quick action in the event that new evidence comes to light.”

Shortly after his release, McAlister hugged his mother and sister and said, “It’s a great day. It’s a wonderful day.”