PENSACOLA, FLORIDA - DECEMBER 06: A general view of the atmosphere at the Pensacola Naval Air Station main gate following a shooting on December 06, 2019 in Pensacola, Florida. The second shooting on a U.S. Naval Base in a week has left three dead plus the suspect and seven people wounded.  (Photo by Josh Brasted/Getty Images)
PHOTO: Josh Brasted/Getty Images North America/Getty Images
PENSACOLA, FLORIDA - DECEMBER 06: A general view of the atmosphere at the Pensacola Naval Air Station main gate following a shooting on December 06, 2019 in Pensacola, Florida. The second shooting on a U.S. Naval Base in a week has left three dead plus the suspect and seven people wounded. (Photo by Josh Brasted/Getty Images)
Now playing
02:05
Source: Saudi who took video was not involved in attack
WASHINGTON, DC - MARCH 05: Sen. John Cornyn (R) (R-TX) talks with Sen. Joe Manchin (D-WV) while walking to the U.S. Senate chamber for a vote March 05, 2021 in Washington, DC. The Senate continues to debate the latest COVID-19 relief bill.  (Photo by Win McNamee/Getty Images)
PHOTO: Win McNamee/Getty Images
WASHINGTON, DC - MARCH 05: Sen. John Cornyn (R) (R-TX) talks with Sen. Joe Manchin (D-WV) while walking to the U.S. Senate chamber for a vote March 05, 2021 in Washington, DC. The Senate continues to debate the latest COVID-19 relief bill. (Photo by Win McNamee/Getty Images)
Now playing
02:54
Axelrod breaks down Manchin's surprising move
sinema
PHOTO: CNN
sinema
Now playing
01:50
Senator's move has many on the internet outraged
PHOTO: FBI
Now playing
02:58
Trump State Department official charged in Capitol riot
WASHINGTON, DC - JANUARY 06: U.S. Sen. Paul Gosar (R-AZ) speaks on the floor of the House Chamber during a joint session of congress on January 06, 2021 in Washington, DC. Congress held a joint session today to ratify President-elect Joe Biden's 306-232 Electoral College win over President Donald Trump. A group of Republican senators said they would reject the Electoral College votes of several states unless Congress appointed a commission to audit the election results. (Photo by Drew Angerer/Getty Images)
PHOTO: Drew Angerer/Getty Images
WASHINGTON, DC - JANUARY 06: U.S. Sen. Paul Gosar (R-AZ) speaks on the floor of the House Chamber during a joint session of congress on January 06, 2021 in Washington, DC. Congress held a joint session today to ratify President-elect Joe Biden's 306-232 Electoral College win over President Donald Trump. A group of Republican senators said they would reject the Electoral College votes of several states unless Congress appointed a commission to audit the election results. (Photo by Drew Angerer/Getty Images)
Now playing
02:19
This is what Rep. Gosar was posting days before Capitol riot
John King Magic Wall 0305
PHOTO: CNN
John King Magic Wall 0305
Now playing
02:17
President Biden sending a team to the US-Mexico border
Senior Advisor to the President Jared Kushner  attends a press conference on September 4, 2020, in the Brady Briefing Room of the White House in Washington, DC. (Photo by Brendan Smialowski / AFP) (Photo by BRENDAN SMIALOWSKI/AFP via Getty Images)
PHOTO: BRENDAN SMIALOWSKI/AFP/AFP via Getty Images
Senior Advisor to the President Jared Kushner attends a press conference on September 4, 2020, in the Brady Briefing Room of the White House in Washington, DC. (Photo by Brendan Smialowski / AFP) (Photo by BRENDAN SMIALOWSKI/AFP via Getty Images)
Now playing
02:50
Jared Kushner disappears from Trump's inner circle
Rep john garamendi 0305
PHOTO: CNN
Rep john garamendi 0305
Now playing
02:33
Rep. Garamendi: Any lawmaker involved in Capitol riots ought to be thrown out of Congress
Protesters gather at Lincoln Park to demand the Emancipation Memorial be taken down on June 23, 2020 in Washington, DC.
PHOTO: Tasos Katopodis/Getty Images
Protesters gather at Lincoln Park to demand the Emancipation Memorial be taken down on June 23, 2020 in Washington, DC.
Now playing
03:01
Why some people want this Abraham Lincoln statue taken down
psaki
PHOTO: CNN
psaki
Now playing
00:56
Psaki fires back at Trump testing czar over vaccine claims
PHOTO: CNN
Now playing
03:04
Avlon: Pence's op-ed is 'way worse than Stockholm syndrome'
PHOTO: CNN
Now playing
01:35
See what security looks like outside US Capitol
PHOTO: Gov. Cuomo's office
Now playing
03:35
Gov. Andrew Cuomo addresses women's allegations
Cuomo
PHOTO: Gov. Cuomo's Office
Cuomo
Now playing
00:56
Cuomo says he has no plans to resign
Now playing
04:51
Elected Republican who supports Biden's bill speaks out
President Joe Biden speaks during a meeting about cancer in the Oval Office of the White House, Wednesday, March 3, 2021, in Washington. (AP Photo/Alex Brandon)
PHOTO: Alex Brandon/AP
President Joe Biden speaks during a meeting about cancer in the Oval Office of the White House, Wednesday, March 3, 2021, in Washington. (AP Photo/Alex Brandon)
Now playing
01:20
'Neanderthal thinking': Biden on states lifting mask restrictions
(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.

Friday’s attack was the second shooting at a military base in three days. Last week, active duty US sailor Seaman Gabriel Romero killed two civilian employees and injured another before killing himself at Pearl Harbor Naval Shipyard in Hawaii. Investigators have not announced a motive for that shooting.

CNN’s Scott Glover, Whitney Wild, Dylan Wells, Melissa Alonzo, Geneva Sands, Ryan Browne, Hollie Silverman, David Shortell, Shimon Prokupecz and Josh Campbell contributed to this report.