A public transit worker shot dead nine co-workers at a California rail yard on Wednesday before turning the gun on himself as police arrived, officials said of the latest mass shooting to hit the United States.
This prompted the state's governor, Gavin Newsom, to ask, almost plaintively and in apparent exasperation: "What the hell is wrong with us?"
Several victims were also wounded in the attack at the rail yard in San Jose city, just south of San Francisco.
The attack has once again shone a spotlight on the country's raging debate over gun control.
"What the hell is wrong with us, and when are we going to come to grips with this?" Newsom declared at a news conference, where he praised the swift response of law enforcement.
At the White House, President Joe Biden called the incident a "horrific tragedy" and ordered flags to be flown at half-staff, saying in a statement before the casualty toll rose:"There are at least eight families who will never be whole again.
"Once again, I urge Congress to take immediate action and heed the call of the American people, including the vast majority of gun owners, to help end this epidemic of gun violence in America."
The suspect was identified by multiple media outlets as Samuel Cassidy. He was an employee of the Valley Transportation Authority, which provides rail and bus services for San Jose, a Silicon Valley tech hub of almost a million people.
San Jose Mayor Sam Liccardo said: "This is a very dark moment for our city and for our community."
The shooter's ex-wife Cecilia Nelms told the Bay Area News Group that Cassidy had "often spoken angrily about his co-workers and bosses, and at times directed his anger at her".
Local officials said the shooting took place at an employee meeting, with at least 80 staff on site at the time.
The US has a long and painful history of deadly gun violence in the form of a steady toll of shootings as well as high-profile mass killings that have targeted schools, work places, concerts and shopping centers.
There were more than 43,000 gun-related deaths in the country last year, including suicides, the Gun Violence Archive, a nonprofit research group, said in a report.
Biden last month branded US gun violence an "epidemic" and an "international embarrassment".
Texas, however, is about to take a major step toward having almost no restrictions on handguns, media reported, even if it already has some of the loosest gun laws.
The bill approved on Monday by the Legislature is awaiting the signature of Governor Greg Abbott, who has said he will sign it.
Texas already allows rifles to be carried in public without a license. The measure sent to Abbott allows anyone aged 21 or over to carry a handgun as long as they do not have a felony criminal conviction or some other legal prohibition in their background.
Agencies, Lia Zhu in San Francisco and Ai Heping in New York contributed to this story.