(CNN) The FBI is presuming a shooting at Naval Air Station Pensacola in Florida that left three sailors dead "was an act of terrorism," the FBI special agent leading the investigation said Sunday.

Mohammed Alshamrani, a 21-year-old second lieutenant in the Royal Saudi Air Force and a student naval flight officer, opened fire on Friday in a classroom building, the FBI said. Alshamrani was killed after two deputies exchanged gunfire with him.

Alshamrani's motive for the attack is still undetermined. Investigators want more information on Alshamrani's time back in Saudi Arabia before his return this year, according to a law enforcement official briefed on the investigation.

FBI Special Agent in Charge Rachel Rojas said investigators are working with "the presumption that this was an act of terrorism," as they do in most similar cases. It allows agents to take advantage of certain "investigative techniques," she said.

"Members of the FBI's Joint Terrorism Task Force and the FBI's Counterterrorism Division are working tirelessly to discern if any possible ideology that may have been a factor in this attack," she said.

No credible threat to the community exists, Rojas said.

While the FBI is still determining whether to classify the violence as terrorism, White House national security adviser Robert O'Brien on Sunday said it "appears to be a terrorist attack."

It does not appear Alshamrani had ties to terrorist groups, two sources told CNN. He had been training at the Florida base for two years, according to a spokesman for the assistant to the defense secretary.

FBI examining surveillance video

The FBI on Sunday said agents collected surveillance videos and videos taken by a bystander as part of the investigation.

The bystander videos were taken after the attack had begun and first responders had arrived, FBI public affairs officer Amanda Worford said in a news release. Investigators have interviewed the bystander and are analyzing the videos for clues, she said.

At least one Saudi national filmed the shooting, according to US Defense Secretary Mark Esper.

Friends of Alshamrani were detained after the killing. Esper said one or two of those friends recorded the attack.

Esper told "Fox News Sunday" that it was unclear whether they were "filming it before it began or was it something where they picked up their phones and filmed it once they saw it unfolding."

A senior law enforcement official told CNN on Sunday that one Saudi national who captured the aftermath of the attack is considered a bystander.

The source says investigators do not believe this person was involved in the attack and was far away from the scene when he captured the emergency response after the incident.

A separate law enforcement official familiar with the ongoing investigation says there is currently no indication of anything nefarious regarding any individual who recorded the attack scene. The official says all witnesses to the incident are being interviewed.

Sources: The gunman bought his weapon legally

Alshamrani legally bought the gun he used to kill three sailors at Naval Air Station Pensacola in Florida, according to two law enforcement sources.

One source said Alshamrani purchased the weapon from a gun store earlier this year. He obtained a hunting license, which allows a non-immigrant on a non-immigrant visa to purchase a gun, the source said.

Alshamrani used a Glock 9 mm pistol he bought "legally and lawfully," Rojas told reporters.

Escambia County Sheriff David Morgan told CNN that the FBI had secured the areas on base where the shooter was staying, and agents had recovered his laptop and cell phone.

A senior administration official told CNN that investigators found some statements and online materials that give cause for concern but noted that it was still early in the investigation.

Just minutes before authorities were first alerted to the shooting, a Twitter account aligning with Alshamrani's name posted a message that raises the possibility the attack was inspired by al Qaeda and its founder, Osama bin Laden, CNN's Nic Robertson and Paul Cruickshank wrote.

The first call alerting law enforcement of an incident at the Florida base came about 6:51 a.m., according to the Escambia County Sheriff's Office.

Twelve minutes before, at 6:39 a.m., a Twitter account with the handle @M7MD_SHAMRANI posted a message addressed to the American people, declaring hate for Americans because of their "crimes" against Muslims.

CNN has been unable to verify the source of the tweet, which was previously reported on by SITE Intelligence Group. Law enforcement has not commented on it. The message repurposed words used by bin Laden and the American al Qaeda terrorist cleric Anwar al-Awlaki.

When asked about the account, Twitter spokeswoman Aly Pavela confirmed the account was suspended and said, "That's all we have to share."

Gunman went to New York over Thanksgiving

Before Friday's attack, Alshamrani watched mass shooting videos at a dinner party, The New York Times reported, citing a source with knowledge of the investigation but not authorized to speak publicly.

Alshamrani and a small group of Saudi nationals had just traveled to New York City over the Thanksgiving holiday, a law enforcement source told CNN.

They visited several museums and Rockefeller Center. Authorities don't know why they traveled to the city, the source said. The Saudis who accompanied Alshamrani are currently being interviewed by law enforcement and are being cooperative, the source added.

Earlier on Saturday, a US official told CNN that several Saudi nationals have been detained for questioning in connection with the shooting. The US official did not provide information about the connection between the shooter and the Saudis or the status of those who were detained.

Alshamrani had been training at the Florida base for two years, according to a spokesperson for the assistant to the defense secretary.

Foreign students from "partner nations" have trained at the base to learn naval aviation for years, said Capt. Tim Kinsella, the commanding officer of NAS Pensacola.

Florida Gov. Ron DeSantis on Sunday called for a more stringent vetting process for foreign military personnel who are given access to US bases.

"I think there is a frustration with this," he said. "You have foreign military personnel coming to our base. They should not be doing that if they hate our country."

DeSantis added, "For us to be bringing in these foreign nationals, you have to take precautions to protect the country."

The victims

The three US Navy sailors were killed because they "didn't run from danger" after the gunman opened fire at the base, Kinsella said.

The sailors were Airman Mohammed Sameh Haitham, 19, of St. Petersburg, Florida; Airman Apprentice Cameron Scott Walters, 21, of Richmond Hill, Georgia; and Ensign Joshua Kaleb Watson, 23, from Enterprise, Alabama.

Several others were wounded, including two sheriff's deputies and a Navy police officer, Escambia County Chief Deputy Chip Simmons said at a prayer vigil in Pensacola Saturday.

One deputy, who was shot in the arm, was treated and released on Friday. The other deputy had surgery on Friday and is expected to recover, Simmons said.

The Navy officer is "going to be fine," Simmons said.

Details about the others who were wounded were not available.