The shooting in Half Moon Bay, about 30 miles (50 km) south of San Francisco, came on the heels of another mass shooting in the southern California city of Monterey Park on Saturday that killed 11 people.
California Governor Gavin Newsom said he was visiting Monterey Park victims in the hospital when he was called away and informed of the shooting in Half Moon Bay, about 380 miles (610 km) to the north.
"Tragedy upon tragedy," Newsom said on Twitter.
The rural area was recently pounded by a series of heavy rainstorms that caused extensive damage, affecting immigrant laborers in the area, farm worker advocates said. A series of atmospheric rivers in the three weeks following Christmas killed 20 people statewide.
San Mateo County Sheriff Christina Corpus identified the suspect as Chunli Zhao, 67, and said he worked at one of the shooting locations. Corpus called the sites nurseries, and other officials said they were staffed by farm workers. Local media described at least one of them as a mushroom farm.
"There were farm workers affected tonight. There were children on the scene at the incidents. This is a truly heartbreaking tragedy in our community," San Mateo County Supervisor Ray Mueller told reporters. "The amount of stress that's been on this community for weeks is really quite high."
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.
A woman who witnessed the arrest told reporters she had gone to the sheriff's department to get more information as she was involved in agriculture and concerned about the well-being of the farm workers.
"I came down here to find out what I could about the situation and why this happened and I hadn't expected to get quite that close to it," Kati McHugh told reporters on the scene. "It was a little too close for my comfort."
There were 38 mass shootings in the United States in the first 21 days of the year, according to the Gun Violence Archive, which describes a mass shooting as four or more people shot or killed, not including the shooter.