Buddy Rivera, who formerly worked at the Navy’s international education and training center in Pensacola, said the programs teach allied military personnel to operate under a common language and procedures, which are critical in joint missions. He said the programs pay dividends as people who train in the United States rise in the ranks of their security forces.

“They are a person of influence today or they are going to be a person of influence tomorrow,” Mr. Rivera said.

Saudis have been a large presence at the Pensacola base, said Mr. Rivera, adding that the facility has dedicated special resources for Saudi personnel in case they need support on base or cultural help in the community.

Sameh Haitham, whose 19-year-old son, Airman Mohammed Haitham, was killed in last week’s shooting, said he was angry and heartbroken. But he said that as a foreigner himself — he is from South Yemen, though his son grew up in Louisiana and Florida — he knows not all Saudis share the sentiments of the gunman and believes the foreign training is beneficial.

“I think it’s a great opportunity to train here in the U.S., in order to go back and defeat terrorists in their countries,” Mr. Haitham said. “But we must be very, very careful on who’s allowed to come in.”

A 34-year-old Iraqi Air Force sergeant who received language and avionics training from the American military said the United States should not be scared off by the actions of one Saudi airman. The sergeant, who asked that his name not be published because he did not have authorization from his military command to speak, said he appreciated the kindness of the Americans he met.

The suspect in the Pensacola shooting, identified as Second Lt. Mohammed Alshamrani, arrived in the United States in 2017, first taking language classes in Texas before coming to Florida for a series of training programs, most recently including strike-fighter training. An analysis of a Twitter account suspected to be Mr. Alshamrani’s suggested that he may have been influenced as early as 2015 by four religious figures who are considered extremists, a Saudi official said.