DNA and genetic genealogy for the first time ever have helped exonerate a man who was convicted of a murder he didn’t commit.

Christopher Tapp, 42, spent 20 years in prison for aiding and abetting the rape and murder of 18-year-old Angie Dodge in Idaho Falls, Idaho, in 1996—a crime for which he falsely confessed.

“I’m thankful I’ve been given this second chance at life,” Tapp told a judge at his exoneration hearing Wednesday, according to the East Idaho News. “I’ve wasted 20 years of my life for something I never did.”

IDAHO MAN ARRESTED FOR 1996 RAPE, MURDER THAT COST ANOTHER MAN 20 YEARS IN PRISON

Crime scene DNA uploaded to the public genealogy website GEDMatch led to the arrest in May of Brian Dripps Sr., 53, for Dodge’s murder. He lived across the street from her at the time of the murder.

Dripps said he acted alone and police believe him, Bonneville County Prosecuting Attorney Daniel Clark said at the hearing.

“There are no doubts that there are failings in the criminal justice system and I think this case is evidence of that,” Clark said.

Tapp was freed from prison in 2017 when the crime scene evidence didn’t match his DNA, the East Idaho News reported. His murder conviction still stood, though.

The arrest of the “Golden State Killer” last year in California using DNA and genetic genealogy has led to the technique being used in dozens of cold case murders and rapes across the country that police couldn't solve with more traditional investigative techniques.

LAPD OFFICER LINKED TO TWO SEPARATE RAPE CASES BY DNA 'COLD MATCH': POLICE

"The light has to shine in both directions," Greg Hampikian, executive director of the Idaho Innocence Project, told BuzzFeed News. "It has to shine into the future to find criminals, and it has to shine into the past where there has been a miscarriage of justice."

Genealogist CeCe Moore cracked the Dodge case after getting a call from the victim’s mother, BuzzFeed reported Thursday. She created a family tree after finding a distant relative of Dripps' on GEDMatch.

Carol Dodge had grown convinced Tapp had nothing to do with her daughter’s murder.

CLICK HERE TO GET THE FOX NEWS APP

“This has literally shattered my family as if we were a piece of glass,” she said, according to The New York Times Friday. “There is no way to pick up the pieces.”