A hero account clerk died in the Virginia Beach massacre after leaving a safe spot to try to save his work friends, it emerged Sunday.

Pastor’s son Ryan Keith Cox, 50, was with nine city staffers who reached a safe room as shots rang out in the municipal building on Friday, according to NPR.

As the group started using a heavy cabinet to barricade themselves in, Cox left in the hopes of saving others.

“He said, ‘Stay here, stay quiet,’ ” close friend Christi Dewar, 60, told the station.

“I said, ‘Come on,’ and he said, ‘I have to go check on the other ones.'”

Their refuge soon came under fire — and Cox, outside and defenseless, became one of the 12 slaughtered while all those inside the break room survived.

“Two bullets almost came through the back of the cabinet,” Dewar recalled.

“We fell to the ground, then we heard other shots close to us.

“That’s when he got Keith,” Dewar told NPR while choking up.

She recalled a cop warning her “not look down” when she was finally led out of the building.

“As we went down the stairwell, I had to step over one of my friends,” she recalled.

She called Cox her special bond with Cox. “I called him my big teddy bear,” she told NPR. “Every time I was upset, he would give me a hug.

“He’s the type of person who you know would lay down his life for someone, just like he did.”

She was also shocked that another colleague, DeWayne Craddock, 40, could be the killer.

“He was very well-dressed. He was soft-spoken,” she said.

“If he had a gun behind his back, and he walked up to me, I would’ve gone up to talk to him.

“I would have no way of knowing.”

She said he was silent throughout the massacre.

“Not one word mentioned from his mouth,” she said. “It was like he was methodical. He had a plan. And he executed it out. He knew exactly what he was doing and where he was going.”

Dewar is now calling for every city office to have metal detectors.

” I would be happy to go through a search every single day if it kept from this ever happening again,” she told NPR.