The FBI is working under the presumption that a fatal shooting at a Florida naval base carried out by an aviation student from Saudi Arabia was an act of terrorism.

All international students at the Pensacola base have been accounted for, there have been no arrests, and the community is under no immediate threat, special agent Rachel L Rojas said at a news conference.

A Saudi commanding officer has ordered all students from the country to remain at one location at the base, officials also said at the news conference.

Mohammed Alshamrani
Mohammed Alshamrani opened fire inside a classroom at Naval Air Station Pensacola (FBI via AP)

Additionally, authorities believe the gunman made social media posts in which he talked about US support for Israel and claimed that Americans are anti-Muslim, a US official told The Associated Press on Sunday.

Investigators also believe the gunman visited New York City, including Rockefeller Centre, days before the shooting and are working to determine the purpose of the trip, said the official.

The FBI and others had said they were trying to determine whether the gunman, 2nd Lieutenant Mohammed Alshamrani, 21, of the Royal Saudi Air Force, acted alone. Alshamrani was a flight student at Pensacola, where members of foreign militaries are routinely trained by the US.

Earlier in the week of the shooting, Alshamrani hosted a dinner party where he and three others watched videos of mass shootings, another US official told the AP.

The US has sought the assistance of Saudi officials as they try to piece together information about the gunman and his motive.

Alshamrani opened fire inside a classroom at the base, killing three people and wounding two sheriff’s deputies, one in the arm and one in the knee, before one of the deputies killed him. Eight others were also hurt. Both deputies were expected to survive.

The official who spoke on Saturday said one of the three students who attended the dinner party hosted by the attacker recorded video outside the classroom building while the shooting was taking place. Two other Saudi students watched from a car, the official said.

Ten Saudi students were being held on the base Saturday as part of the investigation, the official said.

US President Donald Trump declined to say whether the shooting was terrorism-related but said on Saturday that he would review policies governing foreign military training in the US.