An employee fatally shot eight people at a California train yard before turning the gun on himself as police closed in.
The shooting took place at the Santa Clara Valley Transportation Authority (VTA) site in San Jose.
“When our deputies went through the door, initially he was still firing rounds,” Santa Clara County Sheriff Laurie Smith told journalists.
Officials say the victims include transit employees.
The gunman opened fire early at around 06:45am local time on Wednesday in the VTA light rail yard.
The gunman was identified as 57-year-old Samuel Cassidy.
His ex-wife, Cecilia Nelms, told the Associated Press news agency that Cassidy would tell her that he wanted to kill his colleagues, but she had never believed he would do it.
Doug Suh, a neighbour of Cassidy, told the Mercury News the gunman was “lonely” and “strange”.
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 Cassidy, 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.
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.