The shooting spree came 4½ years after 13 people died in a rampage on the same Texas base.
Lopez was carrying his semi-automatic weapon in a parking lot when confronted by the female officer, Fort Hood’s commanding officer told reporters.
"He was approaching her at about 20 feet. He put his hands up, then reached under his jacket, pulled out the (.45) and she pulled out her weapon and then she engaged, and he then he put the weapon to his head," Lt. Gen. Mark Milley said late Wednesday.
The female police officer's actions appeared to prompt the end of the killing spree.
“What she did was heroic,” Milley added. "She did her job and she did exactly what we’d expect from U.S. Army military police.”
Earlier, Lopez had opened fire in one building on the base before getting into a vehicle and firing more shots there and in another building.
Lopez was using a .45-caliber Smith & Wesson semiautomatic pistol. Private firearms aren't allowed at Fort Hood, and the weapon — which Milley said was bought locally recently — wasn't registered with base authorities.
Milley said an investigation involving “all appropriate federal agencies” has already begun into what triggered the rampage, which officials believe began with an argument in the motor pool of the base and escalated.
Lopez, a married father, served four months in Iraq in 2011. Milley said he wasn't wounded in action but had "self-reported" a traumatic head injury.
Investigators are “digging deep” into Lopez’ background including “any criminal history…experiences… all the things you would expect us to be doing are being done right now,” he said.