ARLINGTON — In the aftermath of the deadly shooting at a naval station in Pensacola, Florida, acting Secretary of the Navy Thomas Modly says the Pentagon wants Congress to make it harder for foreign nationals participating in military training in the United States to buy guns.

"We're looking at that to see whether or not we can get Congress' support on some ways to, to make that less easy for them to get weapons like that," he said.

In an interview with NBC News, Modly said the Pentagon is considering additional steps to further protect its military installations, military personnel and families.

"Everything is on the table," such as looking at more thorough ways in which foreign nationals are screened, like continuous vetting, he said.

But Modly said training programs — such as the one alleged gunman Mohammed Saeed Alshamrani, 21, was a member of — are vitally important.

"It's very important for our national security, as well as the world’s national security, that we have partners and allies who we train," he said.

Last week, the Pentagon said there were 5,181 foreign students from 153 countries, including 852 Saudis, in the U.S. for Department of Defense security cooperation-related training. According to a Pentagon policy, foreign nationals who want to participate in the program are vetted for terrorist activity, drug trafficking, corruption and criminal conduct.

Alshamrani obtained a valid Florida hunting license on July 11, 2019, which allowed him to legally buy a weapon in the state. Nine days later, he purchased the semi-automatic handgun used in the shooting from a licensed dealer.

The shooting in Pensacola was the second deadly attack to happen at a Naval base in a week. The first was at Joint Base Hickam at Pearl Harbor, where a sailor killed two base employees before killing himself.

In light of both shootings, additional steps are being considered to better look at understanding when people are under stress or expressing potentially destructive behavior.

"We need to do a much better job of being in front of those types of issues," Modly said.

He said the effect of both incidents is being felt across the Navy.

"These are isolated incidents but obviously extremely tragic for us and very, very tragic for our Navy family," he said.

Modly posthumously awarded Wings of Gold to the victims of the Pensacola shooting on Tuesday.

“Although this authorization pales in comparison to their immense bravery in the line of fire, this winging represents the symbolic achievement of the coveted goal that all three came to Pensacola to accomplish: to join the long line of naval aviators, flight officers, and aircrewmen who have served the cause of freedom so valiantly for over a century," Modly said.

Modly who attended the dignified transfer at Dover Air Force Base Sunday evening said being there was "incredibly impactful."

"The three sailors who are deceased because of this act because of this horrific act were heroes," Modly said.

"These kids are very, very young and the danger is always there," Modly said. "It's our responsibility to make sure that everything we do in terms of how we build the force, and how we think about employing the force keeps that in mind and that we do everything we can to keep them safe."