A suspect is in custody after 7 people were killed in Half Moon Bay.

The police arrested a 66-year-old suspect, who the county sheriff said was “fully cooperating.”

Holly SeconJohn Yoon and

HALF MOON BAY, Calif. — A gunman killed seven people at two locations in Half Moon Bay, Calif., on Monday, shaking a state that was still mourning another mass shooting less than 48 hours before.

The police arrested Zhao Chunli, 66, of Half Moon Bay, in connection with the shootings after he was found in his car in the parking lot of a San Mateo County Sheriff’s Office substation in the town, officials said. They added that there was no continuing threat to the community.

The suspect was taken into custody “without incident” and was “fully cooperating,” Sheriff Christina Corpus said. When an officer first spotted the car at the substation, the suspect was unwilling to get out, she said at a news conference, and there was some difficulty in communicating with him because he spoke only Mandarin Chinese. But officers eventually lured him out of the vehicle and arrested him.

The authorities have not established a motive for the shooting, according to Capt. Eamonn Allen of the sheriff’s department. Local law enforcement was working with the F.B.I. and had not uncovered a criminal history for the suspect or any records of past incidents at either crime scene, he said. The sheriff said the suspect was employed at the first shooting location, a mushroom farm, and that the signs so far pointed to a workplace-related shooting.

The dead included five men and two women, officials said Tuesday afternoon, correcting their earlier reports that six men and one woman were dead. Another man was wounded by gunfire and was hospitalized in critical condition. The United Farm Workers union said in a statement that the seven people who were killed were farm workers.

Some of the victims were Hispanic, and others were of Asian descent, the sheriff said. She added that coroners were still working to identify them and to notify their families on Tuesday, a task complicated by the fact that some were migrants.

Gov. Gavin Newsom of California wrote on Twitter that as news of the Half Moon Bay shooting broke, he was at a hospital in Los Angeles, meeting victims of the mass shooting on Saturday night at a ballroom in Monterey Park. In that attack, a gunman fatally shot 11 people and wounded nine others.

“Tragedy upon tragedy,” the governor wrote.

The shootings in Half Moon Bay, a rural seaside town between San Francisco and Santa Cruz, took place around 2:20 p.m. The town’s beaches are a popular surfing destination, and the inland mountains are home to one of the state’s oldest agricultural communities, which employs many migrant workers.

One of the two shooting locations was a plant nursery, the sheriff’s office said.

“There were farmworkers affected tonight,” Supervisor Ray Mueller of San Mateo County said in a news conference. “There were children on the scene at the incidents. This is a truly heartbreaking tragedy in our community.”

He alluded to the storms that have pounded the area over the past month. “The amount of stress that’s been on this community for weeks is really quite high,” he said.