Twelve people were killed Friday in a mass shooting at the municipal center of Virginia Beach, Virginia, after a city employee opened fire in the building, authorities said. One survivor told NPR her co-worker and longtime friend tried to save others in the building — and ultimately lost his life because of his bravery.

Christi Dewar, a public utilities employee for almost 13 years, said she thought it was a drill when a woman ran down an office hallway shouting "active shooter." Dewar said the shots initially sounded "like a nail gun going off." She didn't think a gunman was behind the noises because renovations were going on in the building.

However, as the noises continued, Dewar and Ryan Keith Cox became alarmed. Dewar described Cox as one of her closest friends and a longtime colleague. Both began their government positions on the same day, had desks close to each other and clicked on a fundamental level, she said, according to the outlet.

Get Breaking News Delivered to Your Inbox

The co-workers began to move toward a staircase they believed to be away from the shooting noises when another co-worker ran by, telling them to go in the other direction. While Dewar said she thought the break room would be a safe place, Cox implored them to stay in an office room.

"He said, 'No, stay here, stay quiet,'" Dewar recalled. "I said, 'Come on,' and he said, 'I have to go check on the other ones.'" He told Dewar and seven of their colleagues to barricade themselves in the room, then left. The group blocked the door using a heavy cabinet and kept quiet as they hid behind furniture.

"Two bullets almost came through the back of the cabinet," Dewar recounted. "We fell to the ground; then we heard other shots close to us," she said. "That's when he got Keith."

The victims of the Virginia Beach shooting. Top row from left: Laquita Brown, Ryan Keith Cox, Tara Welch Gallagher and Mary Louise Gayle. Middle row from left: Alexander Mikhail Gusev, Joshua Hardy, Michelle "Missy" Langer and Richard Nettleton. Bottom row from left: Katherine Nixon, Christopher Kelly Rapp, Herbert "Bert" Snelling and Robert "Bobby" Williams. City of Virginia Beach

After the sounds of bullets became harder to hear, Dewar called 911 — and police quickly arrived, she said. An officer held onto her hand as they walked down the steps and told her to "not look down." However, Dewar said she had a difficult time averting her eyes from what lay below her feet.

"As we went down the stairwell," Dewar told the outlet, "I had to step over one of my friends."

"I called him my big teddy bear," Dewar said of Cox. "Every time I was upset, he would give me a hug. When I was upset about something, he knew exactly what to say to make you smile."

The heroic story echoes those of other victims in two recent mass shootings. Student Kendrick Castillo was the sole victim killed in the May shooting at STEM School Highlands Ranch in Colorado. He died trying to stop one of the armed suspects from firing, allowing his classmates to escape. He, along with several other students, helped prevent further violence.

One of the two students killed in the University of North Carolina at Charlotte shooting in late April, Riley Howell, was also lauded as a hero for fighting the gunman. Officials said if it wasn't for his actions, the shooter may not have been disarmed.

The Virginia Beach gunman, identified as city employee Dewayne Craddock, also wounded four people before he died after a long gunfight with police. Craddock gave his two weeks' notice from his government job just hours before the massacre, city officials said Sunday. Eleven of the people killed were city employees, while one worked as a contractor at the Virginia Beach Municipal Center.