Krista McDonald knows all too well that carrying out the duties of a deputy sheriff can place her in the line of fire.

In January 2011, the Kitsap County, Wash., deputy protected two officers downed by an armed gunman, even as the suspect turned his semi-automatic weapon on her. On Wednesday, McDonald was honored for her bravery with a medal of valor, which Vice President Joe Biden presented to her and to 17 other public safety officers from around the country.

“You’re the heart and the soul and the spine of the nation,” Biden said at the start of the ceremony, “and the really sad thing is that it takes an extraordinary act for the community to rise up and recognize what you do. But you know it. You know it.”

On Jan. 23, 2011, the Kitsap County Sheriff’s Office responded to a call that an armed man was acting inappropriately with a young teenage girl outside a Walmart in Port Orchard, Wash., less than an hour from Tacoma.

Outside the store, two deputies, John Stacy and Andrew Edje, found the man sitting with a 13-year-old girl. When they asked the man for identification, he ran, drew a semi-automatic weapon and began firing on the officers, hitting Stacy in the shoulder and wounding Edje with shots to the shoulder and arm.

McDonald, who had come to offer backup, began firing at the suspect from near her patrol vehicle, about 100 feet away. She then abandoned her cover to protect her colleagues, who lay vulnerable where they’d fallen on the parking lot asphalt and in a raised flowerbed.

While under fire, McDonald moved in and shot the man, 31-year-old Anthony Martinez of Utah, in the leg, sending him to the ground. When the young girl ran to Martinez, the man shot her twice before killing himself. The young girl, Astrid Valdivia, later died at a hospital.

“In protecting her fellow officers and doing everything she could to help that girl, Deputy McDonald exhibited extraordinary courage under fire,” Mary Lou Leary, acting assistant attorney general, said at the ceremony.

As soon as McDonald secured the suspect, she worked to save the girl’s life and then performed first aid on the two downed officers, said Kitsap County Sheriff Steve Boyer in an interview Wednesday.

“I am very proud of her,” he said. “I think a vast majority of police officers would step up to the plate and do the same thing, but what she brought to the table was she was cool, calm, collected under fire. … She’s got a real streak of compassion.”

Although McDonald is extremely humble, Boyer said, she recognized the need to bring recognition to women in law enforcement and to the dangers of the job.

“It’s important for people to hear her story. It’s important for citizens to hear what happens,” Boyer said.

Martinez had been out on bail after being arrested for inappropriate contact with Valdivia, who had run away from her foster home in Utah. The sheriff’s department in Washington state investigated whether McDonald rightfully fired her gun, and she was cleared about two months later.

In April 2012, the National Sheriff’s Association honored McDonald as the Charles “Bud” Meeks deputy sheriff of the year.

The medal of valor, the country’s highest honor for acts of bravery by public safety officers, has been conferred upon 78 people since 2003.

Biden and Leary conferred medals to 17 people Wednesday, including nine fallen officers. Biden took an extra moment to hug and whisper a message to recipients who served alongside or accepted medals in place of those men and women.

“From the bottom of my heart, thank you, and on behalf of the president, thank you, thank you, thank you,” he said.