How DNA from family members helped solve the 'Golden State Killer' case: DA A prosecutor described the process as "dogged detective work."

It was a long process to connect the DNA of the unknown "Golden State Killer" to the suspected serial killer and rapist, identified this week as 72-year-old former police officer Joseph DeAngelo.

Here is how the pieces of the puzzle were put together, according to Sacramento County District Attorney Anne Marie Schubert, who described the process to ABC News as "dogged detective work."

The killer, who evaded investigators for decades, is believed to have committed 12 murders, at least 50 rapes and multiple home burglaries throughout California in the 1970s and 1980s. His last known crime was in 1986.

Years later, in the early 2000s, investigators were able to obtain DNA from the unknown killer at one crime scene: the 1980 double murder of Lyman and Charlene Smith. Lyman Smith and his wife were bludgeoned to death in their Ventura County, California, home.

Investigators then started reviewing rape kits -- which contained DNA samples from victims -- in other jurisdictions, Schubert said. The alleged crimes spanned 10 counties.

One of those counties was Contra Costa, where recently retired investigator Paul Holes led the charge to use a genealogy website to find the killer, said Schubert. Holes spent nearly 25 years on this case, she said.

A few months ago, investigators plugged the mystery killer's DNA into a genealogy database.

Based on the pool of people on the genealogy website, investigators were then able to build a family tree of the unknown killer’s relatives. They say they narrowed the search based on age, location and other characteristics, eventually leading them to DeAngelo.

Authorities surveilled DeAngelo and collected his discarded DNA. About six days before DeAngelo's arrest, investigators plugged his discarded DNA back into the genealogy database and found a match, linking DeAngelo's DNA to the DNA gathered at multiple crime scenes, she said.

"We found the needle in the haystack," Schubert said at a news conference Wednesday.

DeAngelo was taken into custody on Tuesday at his home in Sacramento County, the same county where his alleged 10-year crime spree began.

He appeared in court Friday and did not enter a plea. He returns to court May 14.