Nasim Najafi Aghdam opened fire Tuesday at YouTube's headquarters in San Bruno, California, injuring three people before shooting herself dead at the scene, according to authorities.

Law enforcement officials told NBC News that the shooter approached an outdoor patio and dining area around lunchtime and started shooting.

San Bruno Police Department said in a statement that Aghdam, a 39-year-old resident of San Diego, was found inside the building by officers with a gunshot wound that was "believed to have been self-inflicted".

Initial reports suggested one of the victims may have been Aghdam's boyfriend, but the police department wrote later on Tuesday that it was investigating a motive but said "at this time there is no evidence that the shooter knew the victims of this shooting or that individuals were specifically targeted".

A total of four people were transported to local hospitals, three of which were suffering from gunshot wounds, according to police.

A 32-year-old woman was listed in serious condition and a 27-year-old woman in fair condition at San Francisco General Hospital. Authorities did not release names of the victims.

A fourth person was taken to a local hospital with an ankle injury from fleeing the scene.

Who was the suspect?

Nasim Aghdam, 39, claimed on her social media accounts that YouTube was discriminating against her videos, many of which focused on animal rights and veganism, mixed in with musical parodies.

"Youtube filtered my channels to keep them from getting views!" Aghdam wrote on her website.

"There is no free speech in real world & you will be suppressed for telling the truth that is not supported by the system. Videos of targeted users are filtered & merely relegated, so that people can hardly see their videos!"

Aghdam's family told NBC News she was a long-time YouTube user who felt she had been cheated.

YouTube "stopped everything and now she has no income," her father, Ismail Aghdam, said in a brief phone interview. Adding that his daughter was at YouTube on Tuesday but said he did not know how she was involved in the incident.

Aghdam was also thought to be a longtime animal rights activist — nearly a decade ago she took part in a demonstration organised by PETA to protest the killing of pigs during a military exercise.

According to her website, she had four YouTube channels in Farsi, Turkish, English and one devoted to making beaded necklaces.

She worked for her father's electrical company and once had a company of her own called Peace Thunder, public records showed.

'Thoughts and prayers'

President Donald Trump sent his thoughts and prayers to everyone on the scene via Twitter.

Google's CEO Sundar Pichai said in a statement that the situation had been contained and described the event as an "unimaginable tragedy".

Witness accounts

YouTube manager Todd Sherman described how the scene unfolded on Twitter, saying he saw people running from what he first thought was an earthquake but then was told that someone had a gun.

"At that point, every new person I saw was a potential shooter. Someone else said that the person shot out the back doors and then shot themselves," he wrote.

"I looked down and saw blood drips on the floor and stairs. Peaked around for threats and then we headed downstairs and out the front."

A YouTube employee, Vadim Lavrusik, tweeted he heard shots and saw people running.

Twitter user @erinjeanc shared a picture of people being evacuated from the building.

Google employee Ricardo Luis Horna, 29, told NBC News he was on campus when the shooting happened. He witnessed people running away from a nearby building and also started running away. He got into his car with his manager and drove to a nearby restaurant.

"There was chaos in the parking lot. People were running in their cars," he said.

YouTube ban on gun content

Last month, YouTube announced it would ban content promoting the sale of guns and gun accessories as well as videos that teach how to make guns. The NRA called out YouTube for "censorship" on March 27.

Calls for tighter gun control laws

The shooting was the latest in a string of mass killings carried out in the United States in recent years. Most recently, the massacre of 17 people at a Florida high school has led to renewed calls for tighter restrictions on gun ownership.