Several other Saudis on the Pensacola base, which hosts some 200 foreign military trainees, were detained for questioning after the shooting. One of them, who had been at the scene of the shooting with two others, had recorded the chaotic scene in front of the classroom building where the shooting took place. He later told investigators the three of them just happened to be there at that time, were caught up in the moment and he had wanted to record it, said the person briefed on the investigation.

Some of the Saudis were detained in order to make sure every last trainee from that country was accounted for on the base, according to a senior American official. Some Saudis at bases in Oklahoma and Louisiana who had entered the country on the same flight as the gunman earlier this year were also investigated, the official said. No ties to the suspect or to terror groups were found.

The F.B.I. office in Jacksonville has declined to characterize the nature of its investigation, but a local member of Congress said it clearly appeared to be a terrorist attack.

“I said it was terrorism because it was a premeditated terrorist attack and more than one person was involved,” said Representative Matt Gaetz, a Republican whose congressional district includes Pensacola and has been kept abreast of the investigation. “The filming and potential attempts at publication show that this was an attack intended for theatrical effect to terrorize. It is the definition of terrorism.”

Witnesses described a chaotic scene after Friday’s shooting. The classroom building was covered in broken glass, shell casings and obvious signs of horror.

One of the wounded, Ryan Blackwell, a Navy airman and assistant high school wrestling coach, told the Pensacola News Journal that he was at his office on the first floor of the classroom building when he heard gunshots in the hallway. He and his colleagues closed the door and took cover. The gunman shot through the door.

Mr. Blackwell said he had shielded a woman with his body. All three airmen in the office were shot, he said, with Mr. Blackwell wounded in his right arm and pelvis. He and his colleagues were able to open a window and run out, he said.