The attack at Naval Air Station Corpus Christi left a sailor wounded and the gunman dead.
Naval Air Station Corpus Christi
The gunman was identified as Adam Alsahli, according to three officials who spoke to The Associated Press anonymously.
A second "potential person of interest" may still be at large in the community, an FBI official said.
Defense Secretary Mark Esper said that, when the gunman tried to get through the gate, he was stopped by a young sailor.
All gates on the installation remain closed as law enforcement personnel secure the scene.
The lockdown came after shootings last week at a naval air station in Florida and at Pearl Harbor in Hawaii.
Texas law enforcement confirmed that James and Michelle Butler were murdered at a beach campsite near Corpus Christi.
The base says the facility went on lockdown after an unauthorized person who was possibly armed made it onto the grounds.
A man attempted to smash through a security gate, then charged personnel on foot.