For decades, police say, the DNA of the “Golden State Killer” sat in evidence storage — a unique genetic fingerprint that could identify definitively the man who killed 12 people and raped 45 women across California between 1976 and 1986.

And for decades, those samples were basically useless to investigators, who ran into the same wall that has frustrated police since the invention of DNA forensics: A genetic fingerprint is not much good unless you know whom it belongs to.

Whoever the killer was, he apparently was not one of the millions of convicts, offenders and arrestees in the FBI’s national DNA database. The genetic samples from all those crime scenes merely identified the Golden State Killer as a big flashing question mark.

Until this week — when police announced that they had broken through the wall and identified Joseph James DeAngelo as the Golden State Killer suspect using an ingenious technique that thrills law enforcement officials and disturbs privacy advocates:

They tracked their suspect through his family tree.

Police said they checked the crime scene DNA against one of the genealogy sites that have lately become popular — databases filled with the profiles of people who have volunteered their genetic codes in the hope of discovering their relatives and ancestors. GEDmatch, a free service, confirmed that police used it to identify DeAngelo.

The suspected Golden State Killer was not in this database, either, but it didn’t matter. A distant relative of his was, police say, and that person’s DNA partially matched evidence related to the serial killer. Instantly, the pool of suspects shrank from millions of people down to a single family.

Detectives then used traditional investigative techniques to narrow the family members down to one suspect: DeAngelo, a 72-year-old former police officer who lived within a few miles of many of the attacks.

If DeAngelo is indeed one of the most notorious serial killers in U.S. history, then his arrest Tuesday is a milestone in the short history of familial DNA searches — a technique that is still on the fringe of forensic science and that some people think ought to stay there, lest it turn us all into potential informants.

Others, however, hope it could lead to a world where no criminal ever feels safe, lest some distant cousin’s DNA one day lead police to his door.

Police began exploring DNA fingerprinting in 1985 — a year before the Golden State Killer raped and bludgeoned his last known victim. It was used to help convict Florida rapist Tommie Lee Andrews two years later, Time magazine reported — then a string of other criminals, until it became commonplace for police to obtain DNA samples from suspects to use as evidence in court.

The FBI created a database of DNA profiles in the 1990s, and police queued up to check their evidence samples against it, hoping that their suspect might be an ex-convict, or already imprisoned, or otherwise in the system. The method even allowed police to solve old cold cases — some of them initially investigated long before DNA testing existed.

But the database was little help if the person tied to the DNA wasn’t already in it.

One of the first cases in which a family member’s genes led police to a suspect was in Britain. The mutilation and murder of Lynette White on Valentine’s Day in 1988 was one of the country’s most notorious unsolved cases, the BBC wrote. Three men had been wrongly imprisoned for the crime. A massive police hunt had failed to turn up the real killer.

But in the early 2000s, the BBC wrote, police found a new DNA sample at the crime scene “under layers of paint on a skirting board.” The sample didn’t match any profile in Britain’s national database, but it partially matched with a 14-year-old boy whose DNA was on file after an altercation with police.

The boy was born after the murder, obviously, but he unwittingly led police to his uncle, who promptly confessed to the killing.

Police in Los Angeles had a similar stroke of luck in 2010, when the DNA of the “Grim Sleeper” — a serial killer who had gone uncaught for decades — partially matched to a man in the prison system. That man turned out to be the killer’s son, the Los Angeles Times reported. The Grim Sleeper was identified as Lonnie David Franklin Jr. and sentenced to death.

These cases, however, still relied on DNA obtained by police or through court orders — if not from the suspect himself, then from a family member.

It’s only in the past few years, as millions of people have submitted DNA samples to ancestry websites, that police have used familial DNA searches in ways that read like science fiction, whether you find them hopeful or horrifying.

Take the case of the “Canal Killer” — a double slaying in Phoenix that had gone unsolved since the early 1990s. The suspect’s DNA was on file but matched no one in the FBI database.

Then in late 2014, the Arizona Republic wrote, police met a genealogist at a conference and told her about the case. Investigators eventually sent the genealogist, who did not live in the state, a profile of the Canal Killer’s DNA sequence.

Two months later, the newspaper wrote, the genealogist emailed police the suspect’s likely last name — Miller.

This was not some psychic intuition, the Republic reported, but the result of searches the genealogist ran on Family Tree DNA and Ancestry.com, two of the most popular databases.

That family name led police within weeks to suspect Bryan Patrick Miller of the killings. They secretly collected his DNA — possibly from a discarded bottle or trash, the Republic wrote — and arrested him, alleging that he had the same genetic fingerprint as the Canal Killer.

On the more dystopian side of the spectrum, Wired reported on a filmmaker named Michael Usry who was accused of a 1996 murder in Idaho Falls nearly 20 years after the fact — coincidentally the same month that Phoenix police got their break in the Canal Killer investigation.

Usry, who was a teenager at the time of the killing, was picked up by police at his doorstep in New Orleans in December 2014, Wired wrote. He was interrogated by an FBI agent and spent a month under suspicion — all because the killer’s genetic code was similar to his father’s, whose DNA sample had been obtained by Ancestry.com.

But unlike Miller and DeAngelo, Usry’s DNA test ruled him out as a suspect. His father was one of many false positives that plague familial DNA testing, Wired wrote.

“He seemed like a really good candidate,” an Idaho Falls police sergeant told the New Orleans Advocate after Usry was cleared. “But we’ve had that happen before.”

Familial DNA searches, in fact, had an 83 percent failure rate in a 2014 British study, Wired wrote. This is part of the reason that many warn against the practice, even as law enforcement agencies master its uses.

“The technique is arousing fierce objections from privacy advocates, who maintain that it turns family members into genetic informants without their knowledge or consent,” Ellen Nakashima wrote in The Washington Post in 2008, long before the popularity of genealogy sites exploded.

Since then, Wired reported, Maryland and the District of Columbia have banned familial DNA searches, while the method is regulated in several other states, including California, where police used it to track down the Golden State Killer suspect.

“You allow that low-quality potential evidence to start being searched in these unregulated databases,” Stephen Mercer, a former public defender who helped pass the ban on familial search in Maryland, told The Post. “You’re casting a wide net of suspicion over many, many people.”

The use of genetic websites in the hunt for the Golden State Killer also led investigators to misidentify a potential suspect last year, according to court records obtained by the Associated Press on Friday. The daughter of a 73-year-old Oregon City man said authorities swabbed her father for DNA in a nursing home without her knowledge.  

Aware that their millions of customers don’t necessarily want to inform on their relatives, some genealogy companies actively resist handing over data to police, STAT wrote this week.

23andMe, one of the earliest and most popular DNA search companies, has refused all law enforcement requests, the outlet wrote. Ancestry has, too — at least since 2014, when police used its database to erroneously accuse Usry of the 1996 Idaho Falls murder.

However, the California investigators did not use either of those sites to find the family of the Golden State Killer suspect. Rather, they reportedly ran their old evidence through GEDmatch, a relatively small, free service that allows users to upload and analyze their DNA sequences.

“We understand that the GEDmatch database was used to help identify the [suspected] Golden State Killer,” the company said in a statement. “Although we were not approached by law enforcement or anyone else about this case or about the DNA, it has always been GEDmatch’s policy to inform users that the database could be used for other uses.”

It’s precisely those other uses that now, after the sensational break in a 40-year-old serial killer case, excite and alarm so many people.

“I think it’s revolutionary,” Richard Shelby, a former Sacramento County Sheriff’s Department detective who hunted the Golden State Killer in the 1970s, told The Post after this week’s arrest.

“If criminals out there know they can be tracked down this way, they are going to have to try to not leave their DNA at the scene, and that’s nearly impossible,” he said. “It’s one of the best crime-fighting tools to come in a long, long time.”

Justin Jouvenal, Drew Harwell and Tom Jackman contributed to this report.

More reading:

She stalked the Golden State Killer until she died. Some think her work led to the suspect’s arrest.

All we know about Joseph DeAngelo, the Golden State Killer suspect who became a suburban grandfather