The suspect was cooperating with investigators but a motive had yet to be established, Corpus said.
A semi-automatic handgun was found in his car, she said.
Deputies responding to a call found four people dead and a fifth victim with life-threatening wounds at the first location in Half Moon Bay, then found three more dead at another place nearby, Corpus told a news conference.
Video on ABC 7 from the Bay Area showed the arrest as two men in plainclothes and one uniformed deputy, guns drawn, ordered the man out of his car. The suspect came out, was thrown to the ground and searched for weapons. Multiple uniformed officers quickly arrived on the scene with long guns.
Corpus said investigators speculate that the suspect drove to the station to turn himself in. The description of car and license plate were already circulating among law enforcement when a deputy spotted the car in the parking lot, Corpus said.