DNA and genetic genealogy have helped investigators solve a century-old Idaho mystery.

Outlaw Joseph Henry Loveless was killed and dismembered in 1916 and buried in a shallow grave in Buffalo Cave outside Dubois. At the time, Loveless was wanted for escaping from a jail where he was being held for killing his wife with an ax.

Loveless’ remains were found in the cave four decades ago—but not his head--and they remained unidentified until just recently.

CALIFORNIA COLD CASE MURDERS OF COUSINS SOLVED USING DNA THAT WAS 'ALL OVER BOTH CRIME SCENES,' POLICE SAY

Lee Bingham Redgrave, a genealogist with the nonprofit DNA Doe Project, determined the remains belonged to Loveless after painstaking research that included constructing an elaborate family tree of Loveless' extended relatives.

This undated composite sketch shows Joseph Henry Loveless. A man whose headless torso was found in a remote Idaho cave 40 years ago has finally been identified as Loveless, an outlaw who killed his wife with an ax and was last seen after escaping from jail in 1916.  (Anthony Redgrave/Courtesy of Lee Bingham Redgrave via AP)

This undated composite sketch shows Joseph Henry Loveless. A man whose headless torso was found in a remote Idaho cave 40 years ago has finally been identified as Loveless, an outlaw who killed his wife with an ax and was last seen after escaping from jail in 1916.  (Anthony Redgrave/Courtesy of Lee Bingham Redgrave via AP)

The findings were announced Tuesday.

"This is one of the oldest cases solved using autosomal DNA,” the nonprofit’s Antony Redgrave said, according to KTVB. “We solved the case in about three-and-a-half months after getting the DNA information back from the lab."

Investigators obtained DNA from Loveless’ 87-year-old grandson to confirm the remains were those of the outlaw.

Clark County Sheriff Bart May said his office now has a cold case murder to solve.

DNA LINKS MICHIGAN MAN TO 2 UNSOLVED 1998 FLORIDA RAPES, INVESTIGATORS SAY

It was in August 1979 that a family hunting for arrowheads in Buffalo Cave found some of Loveless’ remains wrapped in burlap.

Twelve years later a girl exploring the same cave system found a mummified hand. More excavating by investigators then turned up an arm and two legs nearby, also wrapped in burlap. The head was never found.

Loveless was born in Utah in 1870 and his outlaw life included stints as a bootlegger and a counterfeiter, KTVB reported.

Investigators believe he met his gruesome end shortly after escaping from the St. Anthony Jail on May 18, 1916.

His wife Agnes Octavia Caldwell met her gruesome end two weeks prior.

The effort to identify Loveless’ remains has blown everyone’s minds, Bingham Redgrave said.

CLICK HERE TO GET THE FOX NEWS APP

“The really cool thing, though, is that his wanted poster from his last escape is described as wearing the same clothing that he was found in, so that leads us to put his death date at likely 1916.”

The Associated Press contributed to this report.