The shooting took place at a regional rail yard in San Jose, California early on Wednesday.
A gunman has killed eight people at a commuter train yard in California.
The shooting took place at the Santa Clara Valley Transportation Authority (VTA) rail yard in San Jose.
Officials say the victims include multiple transit employees. The suspect, an employee, is also dead.
The shooting broke out around 06:45 local time (14:45 GMT).
Officials say the suspect may have set his home on fire before the attack.
Across the US, there have been 230 mass shootings so far this year, according to the Gun Violence Archive. A mass shooting is defined by the group as a crime in which four or more people are fatally shot.
Early on Wednesday, the gunman opened fire in the VTA light rail yard. According to a local CBS station, shots rang out during an employee meeting for rail workers.
Police officers arrived at the scene while the shooting was ongoing, officials said.
“Our teams showed exemplary behaviour – what they’re trained to do – as shots were still being fired,” said Santa Clara County Sheriff Laurie Smith at a press conference.
Nine people, including the suspect, are dead. US media report that the gunman died by suicide, but police have not confirmed.
Law enforcement officials told CBS News, the BBC’s partner in the US, that the gunman is 57-year-old Samuel Cassidy.
Deputy Russell Davis, a spokesman for the Santa Clara County Sheriff’s Department, said “deputies did not exchange gunfire” with the suspect.
“Preliminarily, we’re going to go with the assumption it was a self inflicted gunshot.”
Just before the shooting, a fire broke out at a home belonging to the Santa Clara VTA employee, according to local media.
Authorities say they are looking into whether the suspect may have set his home on fire before embarking on the rampage, but they have not confirmed.
San Jose Fire spokeswoman Erica Ray said that officials are investigating “multiple” crime scenes related to the shooting.
Authorities said a bomb squad was sent to the scene, but there was no active threat to the public.
The shooting shut down traffic on nearby streets during the morning commute. Trains halted service at noon local time.
The Santa Clara VTA – Valley Transport Authority – operates three train lines, making up over 40 miles (65km) of rail. It also operates about 70 bus lines in the city.
Santa Clara is the largest county in California’s Bay Area and is home to Silicon Valley. It encompasses several cities in Northern California including Cupertino, San Jose and Mountain View.
Adobe, PayPal, Apple and eBay are all based in the county of nearly two million residents, located about 50 miles south-east of San Francisco.
Speaking from near the crime scene, Governor Gavin Newsom condemned the “rinse and repeat” cycle of US mass shootings.
“What the hell is wrong with the United States of America?” said the Democrat.
“When will we put down our arms?”
US President Joe Biden called the attack a “horrific tragedy” and again urged Congress to take action on gun control.
“Every life that is taken by a bullet pierces the soul of our nation,” he said. “We can and we must do more.”