KILLEEN, Tex.  The police officer who brought down a gunman after he went on a shooting rampage at the Fort Hood Army base here was on the way to have her car repaired when she responded to a police radio report of gunfire at a center where soldiers are processed before being sent overseas, the authorities said Friday.

As she pulled up to the center, the officer, Sgt. Kimberly Denise Munley, spotted the gunman, later identified as Maj. Nidal Malik Hasan, brandishing a pistol and chasing a wounded soldier outside the building, said Chuck Medley, the director of emergency services at the base.

Sergeant Munley  a woman with a fierce love of hunting, surfing and other outdoor sports  bolted from her car, yanked her pistol out and shot at Major Hasan. He turned on her and began to fire. She ran toward him, continuing to fire, and both she and Major Hasan went down with several bullet wounds, Mr. Medley said.

Whether Sergeant Munley was solely responsible for taking down Major Hasan or whether he was also hit by gunfire from her partner is unclear, but she was the first to fire at him, the authorities said.

Sergeant Munley, 34, is an expert in firearms and a member of the SWAT team for the civilian police department on the base, officials said.

Mr. Medley said she had received specific training in a tactic called active shooter protocol, which was intended for this kind of situation.

“She’s absolutely a hero,” he said. “She had the training; she knew what to do. And she had the courage to do it  by doing it she saved countless people’s lives.”

The original 911 call came in at 1:23 p.m., and five minutes later Sergeant Munley had already shot the gunman.

Image Sgt. Kimberly D. Munley, is credited with saving lives. Credit... Agence France-Presse — Getty Images, via Twitter

Lt. Gen. Robert W. Cone, the post commander, praised Sergeant Munley on Friday for reacting so swiftly and without hesitation. “It was an amazing and an aggressive performance by this police officer,” General Cone told The Associated Press.

Sergeant Munley began her career as a police officer in the beachside town of Wrightsville, N.C., after graduating from high school in nearby Wilmington. She quickly earned a reputation for fearlessness, despite her stature. (She stands 5-foot-4.)

Her partner in Wrightsville, Investigator Shaun Appler, recalled how Sergeant Munley saved him one night when she wrestled a large man off him after the man had pinned him down and was trying to take his gun. She earned the nickname Mighty Mouse for that, he said.

“She’s a ball of fire,” Mr. Appler said. “She’s a real good cop.”

In facing down the gunman at Fort Hood, Sergeant Munley was wounded in each thigh and her right wrist. The base’s fire chief applied tourniquets to stop her bleeding, and she was taken to an undisclosed hospital.

Her friends and relatives who spoke to her Friday said she was recovering and in good spirits. Sergeant Munley, who has two children, joined the police force on the sprawling base in January 2008 after several years in the Army, most of them at Fort Hood.

It was there she met her future husband, Matthew Munley, a member of the Special Forces. The couple is in the process of selling their house and moving back to North Carolina, where her husband has been assigned to Fort Bragg, family members said.

They live with their 3-year-old daughter in a tidy community of ranch-style homes on the south side of Killeen. Her neighbors described her as quiet and friendly. She was often seen washing her Chevy Tahoe in front of her house, tending her lawn and playing with her daughter.

One neighbor, Sgt. First Class William Barbrow, said that about a year ago Sergeant Munley chased down a burglar who had been prowling around the neighborhood.

“When she is in uniform, she looks sharp and crisp, her body language says she is professional and there to handle business,” Sergeant Barbrow said.