Richard Jones spent 17 years in prison for a crime he has always insisted he didn't commit. Then attorneys discovered he had a doppelganger: a man who looked nearly identical to him and had a similar name.

On Thursday, Jones was released from prison after witnesses said they could barely tell the difference between the two men and no longer thought Jones was guilty.

Jones told the Kansas City Star that seeing the photo helped him finally understand what had confused and angered him for so many years.

Ricky Amos (left) and Richard Jones (right) Kansas Department of Corrections

"When I saw that picture, it just made sense to me," Jones said. "They say you can’t see the picture clearly if you [are] in it, but if I was outside this picture I would have seen the same thing."

Jones, a resident of Kansas City, Missouri, was charged with aggravated robbery in 1999, after an attempted purse-snatching in a Walmart parking lot resulted in a woman scraping her knee as three drug-addled men made off with her cell phone.

But Jones swore he didn't know anything about the crime — which took place across the state line in Kansas City, Kansas — and was at home with family the day it occurred. Mandatory sentencing resulted in a 19-year term, which he appealed every chance he got. At the time of sentencing, Jones had two young daughters: one, a baby just a few months old.

Last week, Jones' youngest daughter saw him for the first time she can remember. According to Jones' attorney, the 17-year-old girl had tears in her eyes as she greeted her dad. Upon release Thursday, Jones met his young granddaughter as well.

In 2015, other inmates at Lansing Correctional Facility began telling Jones there was another inmate who looked like his twin. On top of being doppelgangers, the other man had the similar-sounding name of Rick.

Jones contacted attorneys at the Midwest Innocence Project and the Project for Innocence at the University of Kansas Law School. They tracked down Ricky Amos, the lookalike who lived on the Kansas side of town.

In booking photos, the two men looked nearly identical, with the same facial hair and cornrows. They are both close to 6-feet-tall and weigh around 200 pounds. The two men are also roughly the same age: Jones was born in 1976, while Kansas corrections records show Ricky Lee Amos was born in 1977.

Richard Jones reconnects with family after being released from prison. Midwest Innocence Project

But only Amos had been linked to the address where the crime began: a drug house where he briefly lived with his mom after the family was evicted from their place around the corner. That same house was where two men told police they picked up 'Rick' and drove to Walmart that fated day of the robbery in 1999, the three men looking for a way to make fast cash.

Amos could not be reached for comment. He is not charged with the robbery and has denied any involvement. Amos is currently incarcerated in Sedgwick County, Kansas after bring sentenced April 13 for twice failing to register as a sex offender related to a 2003 sexual battery charge. Kansas Department of Corrections records show Amos has been in and out of prison for years: on robbery charges, drug possession, sexual assault, and other offenses.

Alice Craig, an attorney with the University of Kansas Innocence Project, helped work to release Jones for the past two years. She told NBC News the original conviction had been a perfect storm of mistakes, ranging from shoddy detective work to potential racial bias. In addition, the entire case rested on eyewitness testimony. There was no other evidence linking Jones to the crime, and he didn't even know the two other men in the car.

"It’s a case where the detectives had just gone to the house once and put a door hanger asking residents to call the police," said Craig.

Jones also had a criminal record of his own: in 1994 he had been sentenced in Kansas on a string of charges related to theft and the sale of steroids.

Richard Jones reconnects with family after being released from prison. Midwest Innocence Project

In the decision on Wednesday, Johnson County Judge Kevin Moriarty said that, "No reasonable juror would have convicted [Jones] in the light of the new evidence."

The robbery victim, noted Moriarty, had not seen her attackers' face. When she originally picked out the police photo of Jones, she "relied mostly upon skin tone" and has since said that "the person that most likely looks like the individual committing the robbery [is] Mr. Amos."

The other witness, a Walmart security guard, did not see the crime itself but chased the car in order to identify its license number. The two other men in the car who identified "Rick" as the robber admitted to being high on drugs at the time.

After Jones reached out to lawyers and asked them to find his doppelganger, they were stunned by the likeness.

"When we pulled up the photos we were shocked," said Craig. "We actually pulled it up in the middle of the law clinic class, with all the interns. Everyone was just floored."

Jones said looking at the photos gave him a sense of resolution: "Either you’re gonna think they’re the same person, or you’re gonna say ‘these guys look so much alike.’ So when I saw that picture, it fell off me. I found that needle in the haystack."

NBC News was not immediately able to reach Jones for comment.

An online fundraiser for Jones has raised over $10,000 since being posted two days ago. Craig noted that Kansas has no law that stipulates compensation for people whose convictions are overturned. Jones can sue the state, but whether he plans to was not immediately clear.