BEIJING — Five Chinese nationals were among the victims of a shooting in the California city of Half Moon Bay, the Chinese Consulate General in San Francisco said.

The Half Moon Bay shooting Monday, which killed seven people, was the second of two shooting attacks in California in recent days that killed a total of 18 people.

“The Consulate General is in communication with the relevant US authorities to follow up on the progress of the investigation,” a spokesperson said in a statement, adding that the Consulate General strongly condemned the violence.

Chunli Zhao, a 66-year-old Chinese citizen and migrant farmworker, was the sole suspect in the massacre at two mushroom farms in the Northern California coastal city.

He was formally presented with seven counts of murder and a single count of attempted murder during his first court appearance in nearby Redwood City on Wednesday.