Image copyright US Navy Image caption Mohammad Sameh Haitham and Joshua Kaleb Watson were two of three young sailors killed

The FBI says it is treating Friday's deadly attack on a Florida navy base as a presumed terrorist attack.

The Saudi gunman - who was training at the Pensacola site - killed three sailors before he was shot dead.

Special agent Rachel Rojas said the FBI was trying to determine if he had acted alone or had connections to a group.

She said other Saudi students had been questioned but not arrested. They were reportedly confined to the base and co-operating with investigators.

The victims of the attack have been named as Joshua Kaleb Watson, 23, Mohammed Sameh Haitham, 19, and Cameron Scott Walters, 21.

The US Navy said the sailors "showed exceptional heroism and bravery in the face of evil".

In Sunday's press conference, Ms Rojas gave almost no details of the investigation's findings so far.

Media playback is unsupported on your device Media caption Rachel Rojas says there is no new 'credible' threat following the shooting

However, she did say that the gunman, 21-year-old Mohammed Alshamrani, bought his weapon legally in the US. It was a 9mm handgun.

It has been reported in US media that Alshamrani played mass-shooting videos to others at a dinner earlier in the week, according to an anonymous official briefed on the investigation.

A Twitter user appearing to match Alshamrani's identity also made a series of anti-US posts before the shooting, an online monitoring group says.

Alshamrani had also filed a formal complaint against one of his instructors over a nickname which he said had humiliated him.

Alshamrani alleged the instructor had called him "Porn Stash", an apparent reference to the moustache of a porn actor, in front of 10 other aviation students in April.

"I was infuriated as to why he would say that in front of the class," Alshamrani wrote in the complaint, the New York Times reported.

Image copyright Reuters Image caption The gunman has been officially named as Mohammed Alshamrani by the FBI

At a separate press conference on Sunday, Florida Governor Ron DeSantis said the gunman had "a major social media trail" and called for more stringent security measures.

"This guy was somebody who just had a deep-seated hatred for the United States and that was pretty clear from that," he said.

"My view is that... for us to be bringing in these foreign nationals, you have to take precautions to protect the country."

Why were Saudis at the US base?

The Pensacola base has long offered aviation training to foreign military forces.

Saudi pilots started training there in 1995, alongside other personnel from Italy, Singapore and Germany.

Cpt Kinsella Jnr said that about 200 international students were enrolled in programmes there. According to its website, the base employs more than 16,000 military and 7,400 civilian personnel.

Alshamrani was a second lieutenant in the Saudi Air Force.

Earlier US Defence Secretary Mark Esper ordered a review of the screening process for foreign military in the US.

Mr Esper told Fox News Sunday he had instructed top defence officials to look into security measures at bases.

President Donald Trump has also pledged to review foreign military programmes.

What happened on Friday?

Authorities were alerted to the shooting at the Pensacola base at 06:51 (11:51 GMT).

It took place across two floors of a classroom building and ended when a sheriff's deputy killed Alshamrani.

Eight people were also injured in the shooting, including two officers, who are expected to recover.

Family members of Joshua Kaleb Watson said he was shot several times but made it out of the building to alert first responders.

On Facebook, his brother Adam Watson wrote: "He died a hero and we are beyond proud but there is a hole in our hearts that can never be filled."

Capt Tim Kinsella, the base's commanding officer, said of the three sailors killed: "When confronted, they didn't run from danger; they ran towards it and saved lives."

Saudi Arabia is a key US ally in the Middle East and President Trump said the Saudi king called him after the attack to "express his sincere condolences and give his sympathies to the families and friends of the warriors who were killed".

Media playback is unsupported on your device Media caption Florida governor: "The Saudi government will owe a debt here"

Questions over the US-Saudi relationship

Just as he did in the wake of the murder of the dissident Saudi journalist Jamal Khashoggi in his country's consulate in Istanbul, President Trump is seeking to play down the significance of the Pensacola shooting.

For a president who largely sees foreign policy in transactional terms, Saudi Arabia is a great customer for the US. Billions of dollars in weapons sales translates into more than 5,500 temporary visas being issued to the Saudi military to come to the US. Saudi personnel make up about 16% of the foreign personnel being trained at US military schools and other facilities. The Pensacola shooting is already raising questions about the vetting of these individuals.

But more broadly it once again highlights the long-standing relationship between Washington and Riyadh - a relationship that many critics in Congress see as increasingly dubious in the wake of the Khashoggi murder and the Saudi military onslaught in Yemen.