Richard Jones had a party with family and friends at his home in Kansas City, Mo., on May 31, 1999. It was Memorial Day and his girlfriend’s birthday.

A few miles across the border, in Kansas City, Kan., three people had been driving around and smoking crack cocaine all day. They eventually ran out of drugs, so they drove to a neighborhood where they knew people sold crack. The three pulled up outside a duplex where a man they knew as Rick joined them.

Rick sat in the front seat and told them to go to a nearby Walmart. He got out of the car and tried to snatch a woman’s purse in the parking lot. She fought, and Rick ended up taking her phone instead. The woman didn’t get a good look at her attacker before he and the others drove away. Neither did the store security guard. All they knew, according to court records, was that he was a thin, light-skinned black or Hispanic man with dark hair.

Police and eye witnesses eventually believed that man was Richard Jones, and that he likely went by the nickname Rick. He was arrested months later and convicted of aggravated robbery the following year, despite his alibi that he never left his house that Memorial Day. One of the witnesses said the robber had a tattoo on his left arm; Jones didn’t have one at that time.

He was sentenced to 19 years of prison.

Jones sat behind bars, bitter and confused about why he was there, his attorney said. Finally, several years later, things began to make sense.

Investigators discovered that the crime Jones was convicted of was very likely committed by another man — his doppelganger with a somewhat-similar first name.

Ricky Amos had been in and out of prison since the 1990s, and at some point throughout the time that Jones was behind bars, the two men ended up in the same Kansas Department of Corrections facility. Inmates told Jones that a man who looks just like him was also a prisoner there. “Hey, you were in the cafeteria and you didn’t say hello to me,” others said, according to his attorney.

The resemblance was uncanny. Their braided hairstyles, goatees, dark eyes, thick eye brows and complexion all look strikingly similar.

“We were just like, holy crap,” said Alice Craig, Jones’s attorney.

Craig, an attorney for the University of Kansas School of Law Project for Innocence, took over Jones’s case in 2015 — 15 years into his prison sentence and after Jones had lost in all of his appeals. He told her about his doppelganger. Slowly, things began to unravel.

Craig and her team found out that Amos lived with his mother in Kansas City, Kan., not far from the Walmart store where the robbery happened. They were evicted sometime in May 1999, Craig said, so they moved in with Amos’s brother and his wife, who lived around the corner — in a duplex on West 41st Avenue, where the three addicts looking for drugs would later pick up the man named Rick.

The eye witnesses, including the robbery victim and the security guard, have since changed their previous testimonies. After they were shown side-by-side photographs of Jones and Amos, they said they wouldn’t have been able to identify Jones as the real robber.

“I am no longer certain I identified the right person at the preliminary hearing and trial,” Tamara Scherer, the robbery victim, said in an affidavit last year. “If I had seen both men at the time, I would not have felt comfortable choosing between the two men and possibly sending a man to prison.”

Edward Miller Jr., one of the three other people in the car the day of the robbery, never identified Jones. He also was not entirely sure about the identity or physical appearance of the man they picked up; he only remembers that he was “smelly and ratty looking,” he wrote in an affidavit.

“I remember having my doubts at trial,” Miller said. “If I had been given these two pictures before trial, I would not have been able to tell them apart.”

“If I were forced to pick one, it would be the man on the left,” he added, referring to Amos’s photo.

John Cowles, a former assistant district attorney who prosecuted the case, said he no longer has a clear memory of it, but said new evidence strongly suggests that the wrong man was prosecuted.

“The information provided to me by Ms. Craig has undermined whatever confidence I had at the time that the trial of Richard Jones resulted in a just result,” Cowles, who’s now in private practice, said in an affidavit. “It is not my place to reach a conclusion that the new information proves Mr. Jones’s innocence, but I do believe that it would be appropriate for Ms. Craig to pursue whatever relief might still be available to Mr. Jones.”

Jones’s conviction was based solely on flawed eyewitness testimony, the greatest contributing factor to wrongful conviction, according to the Innocence Project. Equally flawed is the police photo lineup designed for witnesses to identify no one else but Jones, Craig said. It shows a picture of Jones, along with those of five other black men. He was the only one with light skin.

In a ruling issued Wednesday, Judge Kevin P. Moriarty of the 10th Judicial District in Kansas wrote that no reasonable jury would convict Jones if he were to be tried again, especially with evidence linking Amos to the crime.

Jones, now 41, was freed Thursday, just two years short of finishing his prison sentence. He spent 17 years behind bars, missing his children’s childhoods and the births of his grandchildren. The Midwest Innocence Project also worked on his case.

Jones’s case became widely known after the Kansas City Star published a story last week. A GoFundMe page set up to help him and his family has raised more than $16,000 as of Tuesday morning.

Posted by Midwest Innocence Project on Thursday, June 8, 2017

Amos has denied being involved in the robbery. Craig said he initially denied knowing the address of the duplex, but later admitted living there after he was confronted with a testimony from a young woman who knows him and his family.

Regardless, Amos will not be prosecuted for the robbery because the statute of limitation for the crime has passed.

Jones was not available for the interview Monday, but Craig said knowing about his doppelganger brought some relief.

“He spent a long time in prison being pretty bitter about being convicted of a crime that he didn’t commit, and he knew he didn’t commit,” Craig said. “And he couldn’t figure out why these people would pick him out of a lineup.”

Finally, he knows why.