A general view of the atmosphere at the Pensacola Naval Air Station following a shooting on December 06, 2019 in Pensacola, Florida. Getty Images/Josh Brasted

The Saudi national who fatally shot three people at a Florida Navy base on Friday bought his gun legally even though people designated as „nonimmigrant aliens“ are not typically allowed to do so, NBC News reported.

But the Bureau of Alcohol, Tobacco, Firearms and Explosives says there are exceptions for those with a valid hunting license or permit, and those from „a friendly foreign government entering the United States on official law enforcement business.“

NBC News cited sources that said the shooter had a license and bought his weapon from a dealer in Pensacola.

The gunman, whom news outlets have identified as Mohammed Saeed Alshamrani, was a second lieutenant in the Saudi Air Force who was in the US as an aviation student.

Visit Business Insider’s homepage for more stories.

The Saudi national who fatally shot three people at a Florida Navy base on Friday bought his gun legally even though so-called „nonimmigrant aliens“ are not typically allowed to do so, NBC News reported Saturday.

The gunman, whom news outlets have identified as Mohammed Saeed Alshamrani, was a second lieutenant in the Saudi Air Force who was in the US as an aviation student.

Though non-citizens who hold US visas are typically barred from buying guns, NBC News reported that he exploited a loophole that allowed him to purchase one legally.

The Bureau of Alcohol, Tobacco, Firearms and Explosives says anyone admitted to the US under a nonimmigrant visa is typically „prohibited from shipping, transporting, receiving, or possessing a firearm or ammunition,“ but there are exceptions for those with a valid hunting license or permit, and those who were admitted for „lawful hunting or sporting purposes.“

nas pensacola aerial Google Maps

NBC News cited sources that said the shooter had such a license and bought his weapon from a dealer in Pensacola.

The Washington Post also highlighted another ATF regulation allowing non-citizens to possess firearms if they’re from „a friendly foreign government entering the United States on official law enforcement business.“

US Defense Secretary Mark Esper said Saturday he could not confirm whether the attack was an act of terrorism, and that investigators needed to continue working to determine the motive.

Yet a number of disturbing details have come to light since the shooting, including that the gunman reportedly hosted a dinner party not long before the attack, in which the guests watched mass shooting videos.

The SITE Intel Group also conducted an analysis of what is believed to be the shooter’s Twitter page, which reportedly featured anti-American posts and echoed Osama Bin Laden.