An employee opened fire at a California railyard serving Silicon Valley, killing eight people.

The suspect was also dead, authorities said.

Santa Clara County sheriff’s spokesman Deputy Russell Davis said the suspect was an employee of the Valley Transportation Authority, which provides bus, light rail and other transit services throughout Santa Clara County, the largest county in the Bay Area.

Santa Clara County Sheriff Laurie Smith said it was “undetermined” how the shooter died.

Shooting scene
The scene on TV (KGO-TV/ABC7/AP)

The shooting took place at around 6:30am at a light rail facility in San Jose next door to the sheriff’s department and across a freeway from the airport. The facility is a transit control centre that stores trains and has a maintenance yard.

Mr Davis said the attack resulted in “multiple major injuries”.

He did not know the type of weapon used or whether the gunfire happened indoors or outdoors. He said the victims included VTA employees. Authorities did not release any of the victims’ names.

“These folks were heroes during Covid-19, the buses never stopped running, VTA didn’t stop running. They just kept at work, and now we’re really calling on them to be heroes a second time to survive such a terrible, terrible tragedy,” Santa Clara County Supervisor Cindy Chavez.

VTA trains were already out on morning runs when the shooting occurred. Light rail service was to be suspended at noon and replaced with bus bridges, agency chairman Glenn Hendricks told a news conference.

Railyard Shooting California
Law enforcement officers near the scene of a shooting in San Jose (Randy Vazquez/Bay Area News Group via AP)

“It’s just very difficult for everyone to be able try to wrap their heads around and understand what has happened,” Mr Hendricks said.

Two patients were transported to Santa Clara Valley Medical Centre, according to spokesperson Joy Alexiou. One person was pronounced dead upon arrival, and the other was in critical condition.

Outside the scene, Michael Hawkins told The Mercury News that he was waiting for his mother, Rochelle Hawkins, who had called him from a co-worker’s phone to assure him that she was safe.

When the shooting started, “she got down with the rest of her co-workers” and dropped her phone, Michael Hawkins told the newspaper.

Rochelle Hawkins did not see the shooter, and she was not sure how close she had been to the attacker, her son said.

The attack was the county’s second shooting in less than two years. A gunman killed three people before killing himself at a popular garlic festival in Gilroy in July 2019.

At a news conference, San Jose Mayor Sam Liccardo lamented the “horrific day for our city.”

Gov Gavin Newsom said in a tweet that his office was “in close contact with local law enforcement and monitoring this situation closely.”

Agents from the FBI and the federal Bureau of Alcohol, Tobacco, Firearms and Explosives were responding to the crime scene, officials said.