The gunman watched videos of mass shootings the night before the attack.

The Saudi trainee who carried out the attack on a Pensacola, Fla., naval base showed videos of mass shootings at a dinner party the night before he carried out the shooting, according to a person briefed on the investigation but not authorized to speak publicly.

The gunman and three other Saudi military trainees visited New York City recently, including several museums and Rockefeller Center, according to the person. Investigators are seeking to determine whether the trip was a tourist excursion during the Thanksgiving holiday week in New York, or whether the Saudi trainees had other motives or met with other people there.

Three people were killed and eight others injured in the attack on Friday. The gunman did not have any apparent ties to international terrorist groups, according to a senior American official who was also not authorized to speak publicly.

But several politicians said the shooting should be viewed as an act of terrorism.

“In my judgment, based upon all of the evidence I have seen, the F.B.I. will open this as an international terrorism case,” said Representative Michael McCaul of Texas, a member of the Homeland Security Committee. Mr. McCaul said the F.B.I. had briefed his staff on the case.