Joseph James DeAngelo, of Citrus Heights, California, was arrested on Tuesday and charged with two counts of murder, officials said at a press conference in the state capital Sacramento.
According to local television stations, DeAngelo was a former policeman.
"The magnitude of this case demanded that it be solved," Sacramento County district attorney Anne Marie Schubert said at a press conference. "This case deeply affected this entire state."
Schubert said DNA helped bring the authorities to DeAngelo 40 years after his first attack. "The answer was and always was going to be in the DNA," she said.
Sacramento County Sheriff Scott Jones said DeAngelo had been arrested for the February 2, 1978 murders of a newlywed couple, Brian Maggiore and his wife, Katie, who were shot to death in Rancho Cordova while walking their dog.
Also known as the "East Area Rapist" and "Original Nightstalker," the Golden State Killer carried out at least 12 murders, more than 50 rapes and 120 home burglaries in California between 1976 and 1986, according to the FBI.
His victims ranged in age from 13 to 41.
"Everyone was afraid," FBI special agent Marcus Knutson was quoted on the FBI website as saying.
"We had people sleeping with shotguns, we had people purchasing dogs. People were concerned, and they had a right to be. This guy was terrorising the community. He did horrible things," Knutson said.
The Golden State Killer was the subject of "I'll Be Gone in the Dark," a best-selling book published earlier this year by true crime writer Michelle McNamara.
McNamara died two years ago at the age of 46 but her book helped spark renewed interest in the case.
McNamara's husband, actor and comedian Patton Oswalt, welcomed the news of the arrest and said on Twitter he was flying to Sacramento for the press conference.
"I hope you got him, Michelle," Oswalt tweeted. "I hope THEY got him."
"She would be beyond excited about this. I think this is the definition of bittersweet," Oswalt said.
It appears police have caught the Golden State Killer. Go get Michelle McNamara's excellent book about the case, I'LL BE GONE IN THE DARK.
Last known attack in May 1986
Two years ago, the FBI offered a $50,000 reward for information leading to an arrest in the case.
According to the FBI, the Golden State Killer carried out his attacks starting in the summer of 1976 in the suburbs of Sacramento, California's state capital.
The assailant would break into homes during the night and tie up and rape his female victims, investigators said.
He would take items from the residences including coins, cash, identification and jewelry.
Most of the early attacks occurred in the area of Sacramento, but the FBI said DNA evidence had connected the suspect to a series of rapes and murders in the San Francisco Bay area and the southern part of the state.
The last known case linked to the Golden State Killer was the May 1986 rape and murder of an 18-year-old girl in Irvine.
The Golden State Killer's fifth victim, Jane Carson-Sandler, told The Island Packet newspaper that she had been informed by detectives that there had been an arrest.
"I just found out this morning," she said. "I'm overwhelmed with joy. I've been crying, sobbing."
Carson-Sandler was attacked by the Golden State Killer in her Citrus Heights home on October 5, 1976.
She has written a book about the rape and appeared on a documentary aimed at catching the man behind it.