(CNN) The gunman in a deadly shooting at Naval Air Station Pensacola in Florida was a second lieutenant in the Saudi Arabian military involved in flight training at the station, US Secretary of Defense Mark Esper said Friday.

Officials are looking into whether the shooting was terror-related as a possible motive, but it's still early in the investigation.

Three people were killed in the shooting and at least eight others were injured and taken to a hospital, authorities said.

Two law enforcement sources told CNN the shooter, who was killed, has been identified as Saudi Arabian national Mohammed Alshamrani.

The gunman started his training in August 2017 as part of a three-year program. He was taking classes in basic aviation, initial pilot training and English, according to a spokesperson for the assistant to the Secretary of Defense.

Read More