SAN BRUNO, Calif.—A woman armed with a handgun opened fire at YouTube headquarters on Tuesday, wounding three people before killing herself, police said.

San Bruno Police Chief Ed Barberini said the dead woman was believed to be the shooter in the incident, which occurred around 1 p.m. and sent employees rushing from YouTube’s main office building. Other employees hid in barricaded rooms as gunshots rang out.

The...