The officials said authorities were investigating whether the attack was terror-related.
Police have confirmed a handgun was used in the shooting.
Florida Gov. Ron DeSantis said the Saudi government will owe a debt to the families of the victims in the shooting.
"The government of Saudi Arabia needs to make things better for these victims," DeSantis said, according to Fox News. "They are going to owe a debt here given that this is one of their individuals."
President Donald Trump tweeted the Saudi king has apologized for the incident:
According to the Escambia County Sheriff’s Office, two deputies shot and killed Alshamrani after police responded to reports of an active shooter on the base shortly before 7 a.m.
Eight other people were injured in the incident, according to Escambia County Sheriff David Morgan, including both deputies who confronted Alshamrani.
Florida State Troopers block traffic over the Bayou Grande Bridge leading to the Pensacola Naval Air Station following a shooting Friday in Pensacola, Fla. (Photo by Josh Brasted/Getty Images)
One deputy was shot in the arm, Morgan said, and the other was shot in the knee. Both are expected to recover.
Alshamrani was reported to be in one of the base’s classroom buildings.
The names of the victims have not been released, pending family notifications.
The Jacksonville, Florida, branch of the FBI is on scene and said it is assisting with Escambia County and U.S. Navy officials in the investigation.
Jason Bortz, spokesman for NAS Pensacola, confirmed to the Pensacola News Journal an active shooter was reported sometime around 7 a.m. Both gates were closed and the base was locked down.
Officials said the base has been secured but will remain closed until further notice. Police are not looking for any additional shooters.
“This is a tragic day for the city of Pensacola,” said Pensacola Mayor Grover Robinson. “We are a military town, our hearts and prayers are connected to all those that serve us every single day. We will overcome this, but today this is certainly a tragic day.”
U.S. Sen. Marco Rubio of Florida spoke with the base’s commanding officer.
Vice President Mike Pence responded to the shooting:
NAS Pensacola employs more than 16,000 military and 7,400 civilian personnel, according to its website. It sprawls along the waterfront southwest of downtown Pensacola and dominates the economy of the surrounding area.
It’s home to the Blue Angels flight demonstration team, and includes the National Naval Aviation Museum, a popular regional tourist attraction.
The shooting is the second at a U.S. naval base this week. A sailor whose submarine was docked at Pearl Harbor, Hawaii, opened fire on three civilian employees Wednesday, killing two before taking his own life.