Investigators believe the Saudi gunman who killed three sailors at the Pensacola naval base visited New York City, including Rockefeller Center, days before the shooting and are working to determine the purpose of the trip, a U.S. official said Sunday.

Authorities also believe the gunman made social media posts in which he talked about U.S. support for Israel and charged that Americans are anti-Muslim, said the official, who was not authorized to discuss the matter publicly and spoke to The Associated Press on condition of anonymity.

More Images
This photo taken from video provided by WEAR-TV shows emergency responders near the Naval Air Base Station in Pensacola, Fla., Friday, Dec. 6, 2019.  The US Navy is confirming that an active shooter and one other person are dead after gunfire at the Naval Air Station in Pensacola. Area hospital representatives tell The Associated Press that at least 11 people were hospitalized. The base remains locked down amid a huge law enforcement response.   (WEAR-TV via AP)

Investigators believe the Saudi gunman who killed three sailors at the Pensacola naval base visited New York City, including Rockefeller Center, days before the shooting and are working to determine the purpose of the trip, a U.S. official said Sunday.

Police cars escort an ambulance after a shooter open fire inside the Pensacola Air Base, Friday, Dec. 6, 2019 in Pensacola, Fla.   The US Navy is confirming that a shooter is dead and several injured after gunfire at the Naval Air Station in Pensacola. (Tony Giberson Pensacola News Journal via AP)

FBI agents trying to determine the purpose of his New York visit are attempting to locate and question anyone who may have dealt with him, the official said.

Police cars escort an ambulance after a shooter open fire inside the Pensacola Air Base, Friday, Dec. 6, 2019 in Pensacola, Fla.   The US Navy is confirming that a shooter is dead and several injured after gunfire at the Naval Air Station in Pensacola.  (Tony Giberson Pensacola News Journal via AP)

Alshamrani opened fire inside a classroom at the base, killing three people and wounding two sheriff's deputies, one in the arm and one in the knee, before one of the deputies killed him. Eight others were also hurt. Both deputies were expected to survive.

Police vehicles block the entrance to the Pensacola Air Base, Friday, Dec. 6, 2019 in Pensacola, Fla. The US Navy is confirming that a shooter is dead and several injured after gunfire at the Naval Air Station in Pensacola. (Tony Giberson Pensacola News Journal via AP)

President Donald Trump declined to say whether the shooting was terrorism-related but said Saturday that he would review policies governing foreign military training in the U.S.

A man reads the daily Al-Madina newspaper fronted by a picture of Saudi King Salman at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic reads "King Salman to Donald J. Trump: Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)

Family members and others identified the three dead as Joshua Kaleb Watson, a 23-year-old recent graduate of the U.S. Naval Academy; Airman Mohammed Sameh Haitham, 19, of St. Petersburg, Florida, who joined the Navy after graduating from high school last year; and Airman Apprentice Cameron Scott Walters, 21, of Richmond Hill, Georgia. All three were students at Naval Aviation Schools Command.

A man reads the daily Al-Madina newspaper fronted by a picture of Saudi King Salman at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic at top reads "King Salman to Donald J. Trump: the Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)

A man reads the daily Al-Madina newspaper fronted by a picture of Saudi King Salman at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic at top reads "King Salman to Donald J. Trump: the Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)

Saudi daily Al-Madina newspaper fronted by a picture of Saudi King Salman is displayed at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic reads "King Salman to Donald J. Trump: Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)

Saudi daily Al-Madina newspaper fronted by a picture of Saudi King Salman is displayed at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic reads "King Salman to Donald J. Trump: Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)

The FBI and others are trying to establish whether the attack Friday was an act of terrorism and whether the gunman, 2nd Lt. Mohammed Alshamrani, 21, of the Royal Saudi Air Force, acted alone. Alshamrani was a flight student at Pensacola, where members of foreign militaries are routinely trained by the U.S.

This photo taken from video provided by WEAR-TV shows emergency responders near the Naval Air Base Station in Pensacola, Fla., Friday, Dec. 6, 2019.  The US Navy is confirming that an active shooter and one other person are dead after gunfire at the Naval Air Station in Pensacola. Area hospital representatives tell The Associated Press that at least 11 people were hospitalized. The base remains locked down amid a huge law enforcement response.   (WEAR-TV via AP)

This photo taken from video provided by WEAR-TV shows emergency responders near the Naval Air Base Station in Pensacola, Fla., Friday, Dec. 6, 2019. The US Navy is confirming that an active shooter and one other person are dead after gunfire at the Naval Air Station in Pensacola. Area hospital representatives tell The Associated Press that at least 11 people were hospitalized. The base remains locked down amid a huge law enforcement response.  (WEAR-TV via AP)

FBI agents trying to determine the purpose of his New York visit are attempting to locate and question anyone who may have dealt with him, the official said.

Earlier in the week of the shooting, Alshamrani hosted a dinner party where he and three others watched videos of mass shootings, another U.S. official told the AP on Saturday.

The U.S. has sought the assistance of Saudi officials as they try to piece together information about the gunman and his motive.

Police cars escort an ambulance after a shooter open fire inside the Pensacola Air Base, Friday, Dec. 6, 2019 in Pensacola, Fla.   The US Navy is confirming that a shooter is dead and several injured after gunfire at the Naval Air Station in Pensacola. (Tony Giberson Pensacola News Journal via AP)

Police cars escort an ambulance after a shooter open fire inside the Pensacola Air Base, Friday, Dec. 6, 2019 in Pensacola, Fla. The US Navy is confirming that a shooter is dead and several injured after gunfire at the Naval Air Station in Pensacola. (Tony Giberson Pensacola News Journal via AP)

Alshamrani opened fire inside a classroom at the base, killing three people and wounding two sheriff's deputies, one in the arm and one in the knee, before one of the deputies killed him. Eight others were also hurt. Both deputies were expected to survive.

The official who spoke Saturday said one of the three students who attended the dinner party hosted by the attacker recorded video outside the classroom building while the shooting was taking place. Two other Saudi students watched from a car, the official said.

Ten Saudi students were being held on the base Saturday as part of the investigation, the official said.

Police cars escort an ambulance after a shooter open fire inside the Pensacola Air Base, Friday, Dec. 6, 2019 in Pensacola, Fla.   The US Navy is confirming that a shooter is dead and several injured after gunfire at the Naval Air Station in Pensacola.  (Tony Giberson Pensacola News Journal via AP)

Police cars escort an ambulance after a shooter open fire inside the Pensacola Air Base, Friday, Dec. 6, 2019 in Pensacola, Fla. The US Navy is confirming that a shooter is dead and several injured after gunfire at the Naval Air Station in Pensacola. (Tony Giberson Pensacola News Journal via AP)

President Donald Trump declined to say whether the shooting was terrorism-related but said Saturday that he would review policies governing foreign military training in the U.S.

The U.S. has long had a robust training program for Saudis, providing assistance in the U.S. and in the kingdom. More than 850 Saudis are in the United States for various training activities. They are among more than 5,000 foreign students from 153 countries in the U.S. going through military training.

“This has been done for many decades,” Trump said. “I guess we're going to have to look into the whole procedure. We'll start that immediately."

Police vehicles block the entrance to the Pensacola Air Base, Friday, Dec. 6, 2019 in Pensacola, Fla. The US Navy is confirming that a shooter is dead and several injured after gunfire at the Naval Air Station in Pensacola. (Tony Giberson Pensacola News Journal via AP)

Police vehicles block the entrance to the Pensacola Air Base, Friday, Dec. 6, 2019 in Pensacola, Fla. The US Navy is confirming that a shooter is dead and several injured after gunfire at the Naval Air Station in Pensacola. (Tony Giberson Pensacola News Journal via AP)

Family members and others identified the three dead as Joshua Kaleb Watson, a 23-year-old recent graduate of the U.S. Naval Academy; Airman Mohammed Sameh Haitham, 19, of St. Petersburg, Florida, who joined the Navy after graduating from high school last year; and Airman Apprentice Cameron Scott Walters, 21, of Richmond Hill, Georgia. All three were students at Naval Aviation Schools Command.

Associated Press reporters Lolita Baldor, Ben Fox, Mike Balsamo and Robert Burns in Washington; Jon Gambrell in Dubai; Bobby Caina Calvan in Tallahassee, Florida; and Tamara Lush in Tampa, Florida, contributed to this report.

A man reads the daily Al-Madina newspaper fronted by a picture of Saudi King Salman at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic reads "King Salman to Donald J. Trump: Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)

A man reads the daily Al-Madina newspaper fronted by a picture of Saudi King Salman at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic reads "King Salman to Donald J. Trump: Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)

A man reads the daily Al-Madina newspaper fronted by a picture of Saudi King Salman at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic at top reads "King Salman to Donald J. Trump: the Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)

A man reads the daily Al-Madina newspaper fronted by a picture of Saudi King Salman at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic at top reads "King Salman to Donald J. Trump: the Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)

Saudi daily Al-Madina newspaper fronted by a picture of Saudi King Salman is displayed at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic reads "King Salman to Donald J. Trump: Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)

Saudi daily Al-Madina newspaper fronted by a picture of Saudi King Salman is displayed at a coffee shop in Jiddah, Saudi Arabia, Saturday, Dec. 7, 2019. U.S. law enforcement officials were digging into the background of the suspected Florida naval station shooter Friday, to determine the Saudi Air Force officer's motive and whether it was connected to terrorism. Arabic reads "King Salman to Donald J. Trump: Florida shooter does not represent the Saudi people." (AP PhotoAmr Nabil)