The man who opened fire at the Pensacola naval base Friday was a member of the Saudi military who was receiving aviation training, the base commander has revealed.

Authorities are investigating whether the deadly shooting, which multiple reports are attributing to an officer named 2nd Lt. Mohammed Saeed Alshamrani, is terror-related.

The gunman killed at least three people at Naval Air Station Pensacola and injured eight in a classroom at the Florida flight training base before being shot dead by sheriff’s deputies.

His weapon was a semi-automatic handgun with an extended clip, sources told ABC News.

He was a Saudi national and aviation student, the base commander, Capt. Tim Kinsella, told reporters during an afternoon press conference.

Officials did not confirm the shooter’s name, and Kinsella declined to describe specifics of his training.

“He was just in the aviation pipeline,” the commander said. “That’s part of the FBI to continue their investigation. I’m not going to speak to where he was in the pipeline.”

At a press conference Friday morning, local authorities said gunfire broke out inside a classroom at the base just before 7 a.m. Two deputies with the Escambia County Sheriff’s Department exchanged gunfire with the man.

Seven people were hurt in the shooting, including the two deputies, who suffered non-life-threatening injuries.

Jeff Bergosh, a facilities manager at the base, told MSNBC that more than 10,000 workers go to NAS Pensacola each day.

President Trump said he’s received a full briefing on the “tragic shooting” and also spoke with Florida Gov. Ron DeSantis.

“My thoughts and prayers are with the victims and their families during this difficult time,” Trump tweeted. “We are continuing to monitor the situation as the investigation is ongoing.”

The fatal shooting was the second at a US military facility this week. On Wednesday, a US sailor shot three civilian employees before turning the gun on himself at the Pearl Harbor Naval Shipyard in Hawaii. Two of the victims died.

With Post wires