Authorities confirmed the suspect was a member of the Royal Saudi Air Force who was on the base as part of a US Navy training program designed to foster links with foreign allies.
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, the agency said on Sunday.
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.
Authorities also believe the gunman made social media posts in which he talked about US support for Israel and charged that Americans are anti-Muslim, said the official, who was not authorised to discuss the matter publicly and spoke to The Associated Press on condition of anonymity.
Investigators also believe the gunman visited New York City, including Rockefeller Center, days before the shooting and are working to determine the purpose of the trip, said the official, who was not authorised to discuss the matter publicly and spoke to the AP on condition of anonymity.
The FBI and others are trying to establish whether the attack Friday was an act of terrorism and whether the gunman, 2nd Lt. 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.
FBI agents trying to determine the purpose of his New York visit are attempting to locate and question anyone who may have dealt with him, the official said.
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 on Saturday.
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 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.
President Donald Trump declined to say whether the shooting was terrorism-related but said Saturday that he would review policies governing foreign military training in the US.
The US has long had a robust training program for Saudis, providing assistance in the US and in the kingdom. More than 850 Saudis are in the United States for various training activities.
They are among more than 5,000 foreign students from 153 countries in the US going through military training.
“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."
Family members and others identified the three dead as Joshua Kaleb Watson, a 23-year-old recent graduate of the US Naval Academy; Airman Mohammed Sameh Haitham, 19, of St. Petersburg, Florida, who joined the Navy after graduating from high school last year; and Airman Apprentice Cameron Scott Walters, 21, of Richmond Hill, Georgia.
All three were students at Naval Aviation Schools Command.