It was a female military police officer who confronted the gunman who killed three people and wounded 16 more at Fort Hood on Wednesday, an echo of the previous mass shooting on the base nearly five years ago, an official said.

Lt. Gen. Mark Milley speaks to the media about a shooting that occurred earlier in the day at Fort Hood, April 2, 2014. Milley confirmed that four people were dead in the shooting, including the gunman. (Getty Images/Drew Anthony Smith)

Lt. Gen. Mark Milley, Fort Hood’s senior officer, said that after the gunman opened fire at the base, a military policewoman confronted him in a parking lot. Milley said the gunman first put his hands up, but then reached for a gun. The female officer drew her weapon and engaged him, and the shooter then pointed his gun at his own head and pulled the trigger, he said.

“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,” Milley said late Wednesday.

He called the unnamed officer’s actions “heroic.”

“It was clearly heroic, what she did at that moment in time,” Milley said. “She did her job and she did exactly what we’d expect from U.S. Army military police.”

In November 2009, Fort Hood police officer Kimberley Munley engaged Army Maj. Nidal Hasan in a firefight, Hasan closing in on her before each of their weapons malfunctioned. Munley’s partner, Sgt. Mark Todd, ultimately fired the shot that took Hasan down.

This post has been updated.