The shooting at a Florida air station that left three people dead and eight wounded last week has put the spotlight on federal guidelines that leave Americans vulnerable to attacks in their own homeland from a foreign source.

Investigators have said Saudi airman Mohammed Alshamrani launched a shooting spree Friday at Naval Air Station Pensacola with a Glock 45 handgun purchased legally from a licensed dealer despite not being a U.S. citizen or resident.

That’s because the gunman obtained a Florida hunting license, a relatively easy procedure that qualified him for one of the exceptions to the federal law that prohibits foreign nationals from purchasing firearms in this country.

Alshamrani, who was shot dead at the scene by sheriff deputies responding to the assault, was an officer in the Royal Saudi Air Force training in aviation at the base.

The website for the Bureau of Alcohol, Tobacco, Firearms and Explosives says foreigners who enter the U.S. with a non-immigrant visa are forbidden from possessing firearms or ammunition, unless they meet one of these exceptions:

“(Having) a valid hunting license or permit, (being) admitted for lawful hunting or sporting purposes, certain official representatives of a foreign government, or a foreign law enforcement officer of a friendly foreign government entering the United States on official law enforcement business.’’

Experts on gun policy say that leaves too much wiggle room, especially the hunting license exclusion, which doesn’t establish what kind of weapons are allowable.

“This is a good example of a gun law that is loosely written,’’ said Robert Spitzer, an authority on gun policy who teaches at the State University of New York-Cortland.

“It’s troubling because it doesn’t specify the kind of gun. And it’s troubling because there seem to be no records, no data, no information about how many people are taking advantage of this federal rule about obtaining these weapons. In the abstract it’s a potential security problem, but of course now we know it’s a real security problem given this shooting in Pensacola.’’

Pensacola shooting: Navy grounds Saudi pilot trainees after deadly shooting at Naval base

‘Who would take a Glock to go hunting?’

Shortly after the incident, Florida Gov. Ron DeSantis called for closing what he termed a “loophole’’ in the federal law that allowed a foreign national access to firearms.

But the reality is the Pensacola gunman could have bought such a weapon even without a hunting license in Florida, where private sellers are not required to conduct background checks or ask any questions about the buyer or the intent of the purchase.

According to the advocacy organization Everytown for Gun Safety, last year there were more than 93,000 ads in the Armslist marketplace for guns sold by private sellers in Florida.

Even a background check, which pulls information from a national database, may have served little purpose in this case because it does not include records of possible violations from abroad.

But Spitzer said a more narrowly focused federal law could have stopped the assailant from obtaining the firearm he used in his deadly rampage and raised red flags about him.

“Who would take a Glock to go hunting?’’ he said. “If the goal is hunting, you could have easily written these provisions to specify long guns, not handguns, to specify certain types of hunting weapons.’’

On Tuesday, Yahoo News reported the FBI expressed concerns about the hunting-license exception as far back as May, warning that it could be exploited by extremists and criminals to commit violence. Bureau officials have said they’re investigating the Pensacola attack as a terrorist act.

Gun policy changes could spark ideological clash between Republicans, Democrats

Grant Reeher, a political science professor at Syracuse University who has studied gun policy, said the death toll could have been worse. With a hunting license, the assailant was allowed to purchase a more powerful weapon, although it’s not clear how he would have brought it into the base undetected.

“He could have gotten an AR-platform gun,’’ Reeher said. “There are AR-platform guns that shoot legal hunting rounds, from a .308 on down. I don’t know what that would do if we’re thinking of the lethality it provides somebody.’’

Black Friday gun deals: Background checks surge as shoppers buy in response to gun control proposals

Reeher agrees with Spitzer that the law should be tightened, but points out that will bring up a curious clash of ideologies, with conservatives defending guns but restricting foreign access to the country and liberals opening doors but limiting access to guns.

There is also the issue of the wide variability between states in their requirements to obtain a hunting license, and the possibility license-holders from more restrictive states could access firearms in those with fewer limitations.

Regardless, Spitzer is succinct in his assessment of the hunting license exception:

“Somebody needs to defend why this provision needs to exist at all,’’ he said.

USA Today