A woman opened fire at YouTube’s headquarters in California’s San Francisco Bay Area, wounding four people before she shot and killed herself, police said.

Employees hid and tried to flee while officers and US federal agents swarmed the company’s headquarters complex in the city of San Bruno as multiple emergency reports came in reporting gunfire.

San Bruno Police chief Ed Barberini told reporters the victims had gunshot wounds and were taken to hospitals.

A spokesman for San Francisco General Hospital said it received three patients.

(PA Graphics)
(PA Graphics)

Spokesman Brent Andrew said a 36-year-old man was in critical condition, a 32-year-old woman was in serious condition and a 27-year-old woman was in fair condition.

The hospital was expecting more patients but Mr Andrew did not know their conditions.

Television news footage showed people leaving the building, holding their arms in the air for police to inspect as they were leaving the building.

Officers searched people to make sure none had weapons, and police vehicles surrounded the area

YouTube employee Vadim Lavrusik posted on Twitter that he heard gunshots and saw people running.

He said he was barricaded in a room with his co-workers before being safely evacuated.

Will Hudson said a friend who works for YouTube texted him about the gunwoman.

“I think there might be a shooter in my building,” read one text.

“The fire alarm went off so we started to evacuate and then people (started) running saying there was a shooter.”

Northern California’s Stanford Hospital said it has received four to five patients, but a hospital spokeswoman did not have information on their conditions or their wounds.

An image taken from video from KGO-TV shows a person being searched (KGO-TV/AP)
An image taken from video from KGO-TV shows a person being searched (KGO-TV/AP)

Google, which owns the world’s biggest online video website, posted on Twitter that the company is coordinating with authorities.

The Bureau of Alcohol, Tobacco, Firearms and Explosives also said it responded to the shooting at YouTube’s suburban campus.

The White House said President Donald Trump was briefed on a shooting and that officials were monitoring it.

Mr Hudson said his friend made it safely back to San Francisco and was in contact with his family.

Mr Hudson said he has become used to hearing about gun violence but has never been so close to it before.

“It just feels strange. It feels like it could really be anyone. That’s really the strangeness of it,” he said.

Calls and emails to YouTube representatives seeking comment were not immediately returned.