More than 40 years after the so-called “Golden State Killer” began terrorizing California, raping dozens of women and killing at least 12, authorities announced Wednesday that they had arrested 72-year-old Joseph James DeAngelo, charging him with capital murder.

DeAngelo’s arrest offered a shocking, abrupt development in what had long been one of the most notorious unsolved string of crimes in U.S. history. The gruesome attacks unfolded across California for more than a decade during the 1970s and 1980s, shattering families and frightening communities. Then the crimes stopped, remaining a mystery for a generation, with little sign the case would ever be solved..

Joseph James DeAngelo Sacramento County Sheriff’s Office via Associated Press

The trail ultimately led authorities to DeAngelo, a former police officer living in Citrus Heights, California, a city outside Sacramento. Authorities said DeAngelo – who was an officer during the years when police believe the attacks began – was found through DNA evidence obtained in recent days. Though investigators declined to elaborate on what the DNA evidence was or how it was obtained, they said it clearly linked him to the crimes that had transfixed them for so long.

Authorities said DeAngelo’s name had not been on their radar at any point until last week, but that they were able to link him to homicides and rapes from decades ago.

“The magnitude of this case demanded that it be solved,” Sacramento County District Attorney Anne Marie Schubert said at a news conference in the California capital Wednesday afternoon. “We found the needle in the haystack, and it was right here in Sacramento.”

Sacramento County court records showed that DeAngelo was booked into jail early Wednesday morning on two counts of murder. No bail was set, and it was not known if he had an attorney.

The string of attacks for decades were actually considered three separate sprees, beginning in the mid-1970s in Visalia, California, authorities said, when dozens of home invasions and burglaries led people to call the then-unknown assailant the “Visalia Ransacker.” A later series of horrifying home-invasions and rapes beginning in 1976 in Northern California – attributed to the “East Area Rapist” or the “Original Night Stalker” – included lengthy attacks, sometimes involving sexual assaults on women in front of their bound loved ones. Then a series of slayings involving couples in their homes in Southern California by the “Golden State Killer” lasted up into the mid-1980s.

It wasn’t until 2001 that authorities connected the crimes via DNA evidence.

Through 1986, the FBI said, the attacker killed a dozen people and raped 45. The victims were as young as 13 and as old as 41, they said.

Investigators had said they thought the Golden State Killer may have had a law enforcement background, and DeAngelo fit that bill. Between 1973 and 1979, DeAngelo served as a police officer in two different California police departments, said Sacramento County Sheriff Scott Jones.

The timeline meant that DeAngelo was a law enforcement official when the attacks began, learning how to be a police officer at the same time authorities now believe he was beginning an escalating reign of terror. It remains unclear whether this training and knowledge of law enforcement tactics played a role in how the case stayed unsolved for so long.

“Very possibly he was committing the crimes during the time he was employed as a peace officer,” Jones said Wednesday.

Jones said DeAngelo had worked for the Exeter, California, police department between 1973 and 1976, a department located about 10 miles east of Visalia. John Hall, the city’s police chief, said in an interview Wednesday that no one currently with the department was there at the time. Still, he said, the idea that DeAngelo might have worked for the department was a blow.

Authorities gather outside a home searched in connection with the arrest of a man on suspicion of murder Wednesday in Citrus Heights, Calif. Associated Press/Rich Pedroncelli

“It’s absolutely shocking as well as disheartening and disappointing,” Hall said. “Not only did he commit these horrific crimes, but he did it while wearing the uniform and enjoying the public’s trust.”

The case remained an object of intense focus for many in law enforcement and the public over the years. In 2016, the FBI made a renewed plea – and offered a $50,000 reward – for help in finding what they called “the violent and elusive individual.”

Beginning in 1976, the Golden State Killer is believed to have raped dozens of women in their homes – meticulously planning intrusions, sometimes ambushing entire families, and killing several victims toward the end of the bloodshed, all before vanishing in 1986.

For relatives of the victims, the shock of DeAngelo’s arrest and the charges against him left some feeling a sense of closure. Others were overwhelmed by the sudden news. Jennifer Carole was sleeping in her Santa Cruz home when the text came in at 7:11 a.m. on Wednesday. When she awoke, she could hardly believe it.

“Could this really be him?” a friend had typed out and sent a link to a news article.

Almost four decades after Carole’s father, Lyman Smith, and stepmother, Charlene Smith, were found murdered in their Ventura, California, home, police said they had found a suspect. She was torn by conflicting emotions.

“This is a hard one,” said Carole, 56. “There aren’t really words for this. I have feelings all over the place . . . In my mind, I had him dead as a way to cope, so his capture is stirring up all kinds of emotions.”

Carole said it was a chilling feeling to know the alleged killer had been in the Sacramento area the whole time, the same area her mother and father had lived.

In March 1980, her brother had gone to their father’s home to mow the lawn, but he grew suspicious when the home’s alarm didn’t go off when he entered. He went upstairs to check on his father and stepmother, Carole said, and called 911 after he found sheets pulled up over their bodies.

In Citrus Heights, residents recalled strange encounters with DeAngelo, who neighbors said lived in a home with his daughter and granddaughter. Attempts to reach DeAngelo’s relatives were unsuccessful.

Eddy Verdon recalled meeting DeAngelo after moving to the area and found him to be nosy, eventually discovering DeAngelo on his property three years ago. When he heard someone around the property and looked in the garage, he found DeAngelo ready to flee on his bicycle.

“I stared him down, and he looked at me nervously,” he said. “I never really interacted with him again. Maybe it wasn’t such a bad idea.”

Investigators and amateur detectives have searched for the attacker since his disappearance.

“He was young – anywhere from 18 to 30 – Caucasian, and athletic, capable of eluding capture by jumping roofs and vaulting tall fences,” the crime writer Michelle McNamara wrote in a Los Angeles Magazine profile of the old cases.

McNamara, who wrote a best-selling book about the crimes, wrote that the attacker had entered homes beforehand, “learning the layout, studying family pictures, and memorizing names” in preparation. As a result, she wrote, when someone “woke from a deep sleep to the blinding flashlight and ski-masked presence, he was always a stranger to you, but you were not to him.”

When a woman managed to escape a 1979 attack, McNamara wrote, she said she saw a man pedaling away on a bicycle. The attacker was particularly cruel, McNamara wrote, placing dishes on the male victims he had tied up and “telling him that if he heard the dishes fall, he’d kill the female, whom he would then lead into another room to rape.”

Two people were beaten to death with a fireplace log. Brian and Katie Maggiore were gunned down while walking their dog in Rancho Cordova. A man and his girlfriend were fatally shot in his condo, with a cellophane-wrapped turkey carcass found on the patio. The killer, McNamara later wrote, had eaten some of their leftover Christmas dinner before departing.