SACRAMENTO — Joseph DeAngelo, the alleged Golden State Killer charged with 13 murders up and down the state, was arraigned in Sacramento Superior Court Thursday on additional charges — 13 counts of kidnapping associated with rapes in Contra Costa and Sacramento counties. But for one dogged prosecutor thinking outside the box, those new charges — thought to be past their statute of limitations, would never have happened.

It had been about a month since DeAngelo’s arrest. Investigators were confident they had caught the Golden State Killer — the notorious serial killer and rapist responsible for 13 slayings and more than 50 sexual assaults throughout California in the 1970s and 80s.

Prosecutors had already charged DeAngelo with a number of murders, but investigators in six different counties in Northern and Southern California could not figure out how to charge the 72-year-old Citrus Heights man with any of his alleged sexual assaults. Statute of limitations obstacles eliminated rape charges or other crimes associated with rape.

But Contra Costa prosecutor Paul Graves had an idea.

While reviewing the nine Contra Costa rapes, Graves, the head of Contra Costa District Attorney’s sex crimes unit, discovered an obscure 1970s-era law that could allow prosecution for at least some of those rape cases — charge DeAngelo with kidnapping during the commission of a robbery.

The strategy worked, and added another major accomplishment in the case for a Contra Costa law enforcement figure — former crime lab chief Paul Holes led the effort to use DNA to track down the Golden State Killer, ultimately leading to DeAngelo’s April arrest.

For the male and female victims of the rape attacks, the development was enormous and provided new hope for justice.

“I’m happy this happened and I feel this is a step in the right direction and there’s some recognition for what happened to me,” said Victor Hayes, whose Sacramento County case was one of the 13 new charges. Investigators have said Hayes, who is the first surviving male victim to speak publicly, was tied up during an Oct. 1, 1977 attack where his girlfriend at the time was raped. The attacker — believed to be DeAngelo — stole various items. Hayes thought his case would never be heard in court.

Graves said there was consensus that it couldn’t be done.

“People were only thinking of rape and murder and that’s all they were thinking,” he said.

Graves, with the help of sex crimes unit paralegal Jayla LaPlant, began reassembling police reports, crime lab materials and any evidence they could find from the nine Contra Costa rape cases from 1978 and 1979. He began exchanging emails with Holes, who had recently retired from the DA’s office, and Holes sent copies of police reports from the old cases. Graves studied old law books to familiarize himself with the statutes at the time of the rapes]. Graves was looking for a life sentence-eligible crime that fit, because those have no statute of limitations.

Graves found that in 1973, a law was enacted for kidnapping during a robbery that allowed for a life sentence. To Graves, many of the Golden State Killer rapes met the bar for robbery and kidnapping: The suspect threatened victims with a gun, demanded money or jewelry, took items and forcibly moved a female victim from one room to another.

Compared to the sadistic murders and rapes that would follow, the robbery threats paled in comparison. But Graves realized this could be the key. It was like nailing Al Capone on tax charges.

“It sounds on its face like we’re stretching it, but not in the eyes of the law,” Graves said.

Graves and LaPlant pored over police reports to make sure there was enough evidence to identify DeAngelo as the suspect. There was a DNA match to two Contra Costa cases and two others had enough evidence, he said. Four other cases did not have the right combination of elements, but he continues to investigate one other.

About six weeks ago, Graves shared his legal theory with Holes, and the former colleague reached out to Sacramento District Attorney Anne Marie Schubert, who has led the team of prosecutors working the Golden State Killer case.

“I told her, ‘Hey, you need to contact Paul Graves. He may have figured out a way to charge these rapes,’ ” Holes said.

And one of the case prosecutors did just that.

“Contra Costa did suggest the possibility of filing the kidnap for robbery charge as a possibility in this case,” Schubert said in an email statement. “Our office then did extensive research on it and worked collaboratively with Contra Costa and other counties on the appropriate charges that could be filed.”

In the end, Sacramento County was also able to charge nine of its rape cases using Graves’ legal theory.

“Contra Costa has been a very crucial role in this case,” Holes said. “Despite the fact (DeAngelo) was somewhat of a transient in our jurisdiction.”

Contra Costa District Attorney Diana Becton, who attended Thursday’s hearing in Sacramento, praised the work of Graves and her office.

“You have to give credit to Contra Costa for that legal theory,” she said after the court hearing. “It allowed us to overcome the statute of limitations issues.”

In court Thursday, DeAngelo appeared once again in his orange jail-issued jumpsuit, looking thinner than past court appearances. As Judge Michael Sweet read through all 26 counts against him, he stood and stared straight ahead, not saying a word. Some victims’ families in the audience passed around a box of tissues, and some dabbed tears.

“That’s why we do this job … I signed up to get justice for victims,” Graves said. “It’s one of my proudest moments as a DA to do this.”