Saudi airman who carried out rampage at US naval base showed videos of mass shootings at a party before attack.

A Saudi airman accused of killing three people after opening fire in a Navy classroom appeared to have posted criticism of US wars and quoted former al-Qaeda leader Osama bin Laden on social media hours before the shooting spree.

The SITE Intelligence Group, which monitors media, said the suspect posted a short manifesto on Twitter prior to the attack at the naval base in Pensacola, Florida, on Friday.

The attacker allegedly hosted a dinner party earlier in the week where he and three others watched videos of mass shootings, a United States official told The Associated Press.

The FBI on Saturday formally identified the attacker as Mohammed Alshamrani, 21, a second lieutenant in the Royal Saudi Air Force and a student naval flight officer.

“I’m against evil and America as a whole has turned into a nation of evil. I hate you because every day you [are] supporting, funding and committing crimes not only against Muslims but also humanity,” the group quoted the alleged gunman as saying.

US defence chief Mark Esper said on Saturday he was not yet prepared to label the attack as “terrorism”.

“No, I can’t say it’s terrorism at this time,” Esper said, adding that he believed investigators needed to be allowed to do their work.

The suspect was on the base as part of a US Navy training programme designed to foster links with foreign allies.

One of the three students who attended the dinner party hosted by the attacker recorded video footage from outside the classroom building while the shooting was taking place, an official said, adding that two other Saudi students watched from a car.

According to the official, 10 Saudi students were being held on the base while several others were unaccounted for.

The assault, which prompted a significant law enforcement response and base lockdown, ended when a sheriff’s deputy killed the attacker. Eight people were wounded, including the deputy and a second deputy who was with him.

The NAS Pensacola shooter is identified as Saudi national Mohammed Alshamrani. Anyone with information regarding his activites is encouraged to call 1-800-CALL-FBI. FBI Jacksonville is not aware of any credible threat toward the Pensacola community at this time. pic.twitter.com/RNc8ZL89WS — FBI Jacksonville (@FBIJacksonville) December 8, 2019

Family members identified one of the victims as a 23-year-old graduate of the US Naval Academy who alerted first responders to where the gunman was even after he had been shot several times.

“Joshua Kaleb Watson saved countless lives today with his own,” Adam Watson wrote on Facebook. “He died a hero and we are beyond proud but there is a hole in our hearts that can never be filled.”

The Navy, in an emailed statement, named the other victims as Mohammed Sameh Haitham, 19, and Cameron Scott Walters, 21, both sailors studying at the base.

President Donald Trump tweeted his condolences to the families of the victims and noted he received a phone call from Saudi King Salman bin Abdulaziz Al Saud. He said the king told him “this person in no way shape or form represents the feelings of the Saudi people”.

Trump also said he would review policies governing foreign military training in the US.

“This has been done for many decades,” Trump said. “I guess we’re going to have to look into the whole procedure. We’ll start that immediately.”

The US has long had a robust training programme for Saudis, providing assistance in the US and in the kingdom. A couple of hundred students from countries outside the US are enrolled in training at the Pensacola base.

The shooting was the second at a US naval base in one week. A sailor whose submarine was docked at Pearl Harbor, Hawaii, opened fire on three civilian employees on Wednesday, killing two before taking his own life.