The Saudi aviation student who fatally shot three people at an American naval base in Florida hosted a dinner party earlier in the week where he and three others watched videos of mass shootings, a US official has said.

One of the three students who attended the dinner party recorded video outside the building while the shooting was taking place in a classroom at Naval Air Station Pensacola on Friday, the official added, while two other Saudi students watched from a car.

The source said 10 Saudi students were being held on the base on Saturday while several others were unaccounted for.

Air base shooting
Emergency service personnel at the scene (WEAR-TV via AP)

Those investigating the deadly attack previously said they were working to determine whether it was motivated by terrorism.

The gunman – identified in reports as Mohammed Saeed Alshamrani – only stopped his rampage when he was shot dead by police as law enforcement officials swarmed the area.

Eight people were injured, including two policemen.

Florida Senator Rick Scott issued a scathing statement calling the shooting – the second on a US naval base this week – an act of terrorism “whether this individual was motivated by radical Islam or was simply mentally unstable”.

Naval Air Station Shooting
Navy Captain Tim Kinsella briefs the media following the shooting (Tony Giberson/Pensacola News Journal via AP)

He added it is “clear that we need to take steps to ensure that any and all foreign nationals are scrutinised and vetted extensively before being embedded with our American men and women in uniform”.

However, a national security expert from the Heritage Foundation warned against making an immediate link to terrorism.

Charles Stimson said it should not be assumed that “because he was a Saudi national in their air force and he murdered our people, that he is a terrorist”.

The gunman was a member of the Saudi military who was in aviation training at the base.

US President Donald Trump declined to say whether the shooting was terrorism-related. He tweeted his condolences to the families of the victims and noted that he had received a phone call from Saudi King Salman.

He said the king told him “the Saudi people are greatly angered by the barbaric actions of the shooter, and that this person in no way shape or form represents the feelings of the Saudi people who love the American people”.

The Saudi government offered condolences to the victims and their families and said it would provide “full support” to US authorities investigating the shooting.

On Wednesday, a sailor whose submarine was docked at Pearl Harbour, Hawaii, opened fire on three civilian employees at the US base, killing two before taking his own life.