A Virginia Beach city worker was confronted by gunman DeWayne Craddock three heart-stopping times during the workplace slaughter — but was spared each time.

Ned Carlstrom said he assumed it was an active-shooter drill when he first came face to face with his co-worker carrying an “obnoxious-looking gun” during Craddock’s slaughter of 12 people on Friday.

“He had the gun down at his side. He was so close to me, he swung his arm out, he damn near hit me with the gun. That’s how close we were,” Carlstrom recalled Sunday of their first encounter in a stairwell.

“But he never raised the gun at me. He looked up at me briefly.”

Carlstrom, who works in the billing section of the city water department, still assumed civil engineer Craddock, 40, was acting out a drill for the municipal building.

“By the way he walked past me, he barely gave me a glance and never broke stride,” he said. “I either thought he was playing the part of the bad guy or playing the part of someone pursuing a bad guy.”

Five minutes into the massacre, the killer walked into a room Carlstrom was in — sparing him and his colleague Terry Inman, who had yelled, “DeWayne, stop!”

“He turned and looked straight at me, but he didn’t see me,” recalled account clerk Inman, 61. “He looked straight in my face and he did not see me standing there because he didn’t raise the gun.

“To me, that was the Holy Spirit inflecting something on that man to the point where he didn’t see Terry Inman standing there.”

Carlstrom, of Chesapeake, dodged death a third time when Craddock came right up to the window of an office he was hiding in a little while later.

“We had the door locked, but he could have punched through it or shot through it,” Carlstrom said.

Carlstrom never saw Craddock fire his guns — but heard numerous shots fired, including the one he assumed killed his friend Ryan Keith Cox, who he said was trying to get co-workers to safety when he was killed.

He only realized the full extent of the carnage when he was finally led to safety.

“That’s when I had to step over the body of one of my co-workers in the stairwell,” he said. “I don’t think it will (sink in) until we go back to work and we don’t have these people anymore.”

Police Chief Jim Cervera has insisted that Craddock — who had quit his job hours before the mass shooting — was not known to have been “targeting anyone specifically.”

Carlstrom is also at a loss as to why he was repeatedly spared by the man he only knew from light-hearted conversations in the parking lot.

“I guess it’s a feeling of being fortunate,” Carlstrom said of his emotions.

His colleague Inman was also stunned that Craddock would carry out such carnage.

“It’s so cotton-picking cliche you almost hate to say it, but he has always been rock-solid kind of positive guy. He always had a smile on his face,” Inman said.

“Nothing in (his) character would cause you to think, ‘This guy is going to come in and kill 11 of my colleagues … 12 people that work in the same building.’”

With Post wires