Media playback is unsupported on your device Media caption How the attack on YouTube's HQ in San Bruno unfolded

The suspect in a shooting at YouTube HQ visited a local shooting range just hours before the attack in San Bruno on Tuesday, police said.

Nasim Aghdam, who made videos on the platform, legally owned the semi-automatic handgun used in the shooting, police chief Ed Barberini said.

She was found dead at the scene, apparently of a self-inflicted wound.

Police said the motive for the shooting appeared to be that Aghdam was "upset with the policies" of YouTube.

Earlier reports suggested the 39-year-old believed YouTube was filtering her videos, and reducing the money she could make on the platform.

Three people with gunshot wounds were transported to hospital. Two were released on Tuesday night, but one victim, a man in his 30s, remains in serious condition.

"At this point, we have no indication that she was selecting individuals to fire at," Mr Barberini said. "There's absolutely no link or relationship that we've identified."

Mr Barberini said police were trying to access Aghdam's social media accounts "in order to further comprehend" her motive.

Image copyright http://nasimesabz.com/ Image caption Nasim Aghdam railed against YouTube on her personal website

He added that no other suspects were found at the scene, and that police were not searching for anyone else.

Mr Barberini also responded to US media reports that Aghdam's family had warned police she might go to YouTube because she "hated the company."

"We did not have any information, and we're not aware of any information passed on to any other agency," he told reporters.

Mr Barberini said Aghdam appeared to have accessed the YouTube campus through a parking area, but said police were still investigating what security, if any, she had bypassed.

Local police had previously provided YouTube with "critical incident" training, he said.

What do we know of the suspect?

Nasim Aghdam lived in San Diego in southern California.

Police have revealed few details about her, but US media said she ran a number of channels and a website, posting videos on a variety of subjects including those highlighting animal cruelty. The channels have now been deleted.

Aghdam has been variously described as a vegan bodybuilder, artist and rapper.

Media playback is unsupported on your device Media caption Police chief Ed Barberini said his officers found a "chaotic" scene

In January 2017 she posted a video complaining that YouTube was filtering her content, leading to fewer views.

On her website she also ranted about the firm, saying: "Videos of targeted users are filtered and merely relegated, so that people can hardly see their videos."

She also quotes Adolf Hitler, saying: "Make the lie big, make it simple, keep saying it, and eventually they will believe it."

She also wrote: "There is no equal growth opportunity on YouTube or any other video sharing site. Your channel will grow if they want [it] to!"

Aghdam's father, Ismail, told local US media she was angry because YouTube had stopped paying her for videos.

He said Aghdam had been reported missing on Monday after not answering calls for two days. Police later found her sleeping in her car in Mountain View, 25km (15 miles) south of the YouTube offices and reported this to her family, but they did not detain her.

Her father told police she might go to YouTube as she "hated the company", local media said.

YouTube terminated her account following the shooting. Her Instagram and Facebook accounts have also been removed.

What happened in the attack?

The suspect is reported to have approached an outdoor patio and dining area at the offices in San Bruno, near San Francisco, at about lunchtime on Tuesday and opened fire with a handgun.

San Bruno Police Chief Ed Barberini said officers arrived at the offices at 12:48 (19:48 GMT) local time to find a "chaotic scene", with numerous people fleeing.

Fire officials also said they responded to a fire alarm set off at the same time - though it is not clear if Aghdam or an employee triggered the alarm.

Employees were seen leaving with their hands raised, forming a queue to be individually frisked by police.

Inside the complex officers then found the body of Nasim Aghdam, killed by a self-inflicted wound.

Some 1,700 people work at the YouTube HQ. The company is owned by Google and is the area's biggest employer.

Such "active shooter" incidents are overwhelmingly carried out by men - an FBI report found that out of 160 incidents between 2000-2013, only six of the people who opened fire were women.