"I'm sure there could have been more injury if they hadn't taken him into custody," Stanback said.
The two people shot were taken to a hospital. Stanback said at a news conference that their conditions were not immediately known, though the Navy said on its official Twitter account that neither had life-threatening injuries.
The shooter was a recruiter who had been relieved of duty, said a law enforcement official briefed on the developments. The official was not authorized to discuss the investigation publicly and spoke on condition of anonymity.
Stanback said the shooting happened inside an armory building just outside Naval Support Activity Mid-South. There are more than 7,500 military, civilian and contract personnel working on the base, according to the facility's official website.
The facility is home to human resources operations and serves as headquarters to the Navy Personnel Command, Navy Recruiting Command, the Navy Manpower Analysis Center and the US Army Corps of Engineers Finance Center.
The Navy said the base was briefly placed on lockdown as a precaution, though the lockdown was lifted in the afternoon.