The violence began about 12:45 p.m. in a courtyard outside the video-sharing company's headquarters, just south of San Francisco. Witnesses described seeing a woman shooting a gun in a courtyard as others ran for their lives.
"Upon arrival, officers encountered numerous employees fleeing from the building," said San Bruno Police Chief Ed Barberini. "It was very chaotic, as you can imagine."
Police found one gunshot victim near the entrance of the building, he said.
Two injured women ran across the street and took shelter in a restaurant, officials said.
One of the injured women had a bullet wound to her leg. A restaurant worker told local Fox affiliate KTVU that he fashioned a bungee cord into a tourniquet, helping the woman until she was taken to a hospital.
Authorities did not identify the shooter or the victims. But NBC News and CNN, citing senior law enforcement officials, identified the shooter as Nasim Aghdam, a prolific user of YouTube.
Officials said a fourth person suffered an ankle injury fleeing the scene but was not struck by a bullet.
YouTube's parent company, Google, said it is cooperating with law enforcement.
Google CEO Sundar Pichai said in a written statement he was "grateful to everyone inside and outside the company for the outpouring of support and best wishes. . . . I know a lot of you are in shock right now. Over the coming days, we will continue to provide support to help everyone in our Google family heal from this unimaginable tragedy."
Employees described a chaotic scene inside the corporate offices when the gunshots rang out. Some fled; others hid.
"Now barricaded inside a room with coworkers," he wrote at about 1 p.m.
Todd Sherman, a product manager at the company, described the frightful moments as he evacuated the building.
"I looked down and saw blood drips on the floor and stairs," he wrote on Twitter.
After the incident, President Donald Trump tweeted praise for the quick police response: "Our thoughts and prayers are with everybody involved. Thank you to our phenomenal Law Enforcement Officers and First Responders that are currently on the scene."
Most acts of mass violence are carried out by men, and female shooters are rare. An FBI report of active-shooter incidents nationwide between 2000 and 2013 examined 160 such attacks and found that just six involved female shooters.
The most well-known mass shooting in recent memory involving a female attacker occurred in 2015 in San Bernardino, California, about 380 miles southeast of YouTube's offices. A husband and wife who had pledged allegiance to the Islamic State gunned down 14 people at an office holiday party before they fled and were killed by police.
- - -
Rosenberg and Barrett reported from Washington. Mark Berman in Washington contributed to this report.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.