Investigators in California were able to crack the case of the Golden State Killer using genealogical websites that featured genetic information from a relative, prosecutors said Thursday.

Joseph James DeAngelo, 72, was arrested Tuesday at his Citrus Heights home after a DNA sample matched that of the Golden State Killer — a mass murderer who's believed to be responsible for at least 12 murders, 45 rapes and 120 home burglaries through the state in the 1970s and 1980s.

GOLDEN STATE KILLER SUSPECT ARRESTED IN CALIFORNIA

The Sacramento County District Attorney's Office said Thursday that investigators used DNA from a crime scene years ago and compared it to other DNA samples from family history websites which users send their DNA to in order to learn more about their ancestry.

The district attorney's office "explored online family trees that appeared to have matches to DNA samples from the East Area Rapist's crimes," The Sacramento Bee reported. "They then followed clues to individuals in family trees to determine whether they were potential suspects."

Officials on Wednesday said that DNA helped investigators identify DeAngelo, and led to the case being solved within the last six days.

Sacramento County Sheriff Scott Jones referred to the genetic material as "discarded DNA," but authorities at the time refused to give specifics about how it was collected or matched to the suspect.

Authorities last Thursday reportedly were able to pinpoint that DeAngelo could be a suspect — which led to investigators setting up surveillance in his Citrus Heights neighborhood, and ultimately obtaining the "discarded DNA."

DeAngelo, a former police officer, was taken into custody as he left his home, located 16 miles northeast of Sacramento. Jones said that the 72-year-old was surprised when deputies arrested him and told them he had a roast in the oven.

He's so far been charged with eight murders.

The Associated Press contributed to this report.