ABC News identified the shooter as Nasim Aghdam. Aghdam allegedly has a website with a manifesto that targets YouTube for censorship and demonetization of her video content.
The federal officials told ABC News that the victim in critical condition at San Francisco General Hospital is believed to be the intended target of the shooting. The other victims were apparently unintended victims.
Law enforcement officials said the shooting was being investigated as a domestic dispute. The officials spoke on the condition of anonymity because they were not authorized to discuss the case.
They gave little information about the victims.
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, a spokesman for San Francisco General Hospital said.
Aghdam was not known to have a relationship with anyone in the YouTube facility.
Sources say Aghdam did not have an ID badge but was carrying a purse. Nobody in the facility knew who she was. They added that Aghdam got off 30 or 40 shots before turning the gun on herself.
According to her website, a possible motivation for the shooting could have been tied to her many YouTube accounts, which she says have seen a decline in viewership over the past few months.
READ MORE: Sources identify YouTube shooter as user Nasim Aghdam
Terrified employees huddled inside, calling 911, as officers and federal agents swarmed the company's suburban campus sandwiched between two interstate freeways in the San Francisco Bay Area city of San Bruno.
YouTube employee Dianna Arnspiger said she was on the building's second floor when she heard gunshots, ran to a window and saw the shooter on a patio outside.
She said the woman wore glasses and a scarf and was using a "big huge pistol."
"It was a woman and she was firing her gun. And I just said, 'Shooter,' and everybody started running," Arnspiger said.
She and others hid in a conference room for an hour while another employee repeatedly called 911 for updates.
"It was terrifying," she said.
San Bruno Police Chief Ed Barberini initially told reporters Tuesday that four people were wounded by gunshots. He later clarified that one person who was taken to the hospital had a twisted ankle or similar injury but wasn't shot.
Brent Andrew, a spokesperson at San Francisco General Hospital, says they're treating three people - a 36-year-old man in critical condition and two women, ages 32 and 27, who are in serious and fair condition.
Barberini said one victim was found near the entrance, and two others were injured at a nearby business.
Television news footage showed people leaving the building in a line, holding their arms in the air for police to inspect as they were leaving the building. Officers patted down 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 shooter.
"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."
Google, which owns the world's biggest online video website, said the company's security team worked with authorities to evacuate buildings and was doing whatever it could support the victims and their families.
YouTube's headquarters has more than a thousand engineers and other employees in several buildings. Originally built in the late 1990s for the clothing retailer Gap, the campus south of San Francisco is known for its sloped green roof of native grasses.
Inside, Google famously outfitted the office several years ago with a three-lane red slide for workers to zoom from one story to another.
"Today it feels like the entire community of YouTube, all of the employees, were victims of this crime," said Chris Dale, a YouTube spokesman. "Our hearts go out to all those who suffered."
The White House said President Donald Trump was briefed on the shooting and that officials were monitoring developments.
An eyewitness said he was working at YouTube when the alarm went off at the building. He left the facility on his skateboard, and went through the outdoor plaza, where he saw at least one person on the ground with what he believed to be a gunshot wound.
"When you see someone with a shot to the stomach, you expect the worst but pray for the best," he said.
Re: YouTube situation, we are coordinating with authorities and will provide official information here from Google and YouTube as it becomes available.— Google Communications (@Google_Comms) April 3, 2018
Employees were evacuated with arms overhead, and the campus is flanked with dozens of police cars and emergency vehicles.
Police activity at 901 Cherry Ave, please stay out of the area. pic.twitter.com/H6iAj0g7ra— San Bruno Police (@SanBrunoPolice) April 3, 2018
Just spoke to a shaken mom outside YouTube campus. Her son, 30 year old software engineer was inside during active shooter situation. He heard shots on his lunch break on outside patio. He is now hiding in a bush.— Dion Lim (@DionLimTV) April 3, 2018
VIDEO: Police surround YouTube headquarters in San Bruno
The Associated Press contributed to this report.