As workers at a Virginia Beach municipal building barricaded themselves in their offices Friday, four city cops fought a fierce gun battle with a bloodthirsty gunman, authorities said.

“We kept hearing gunshots. We were trying to keep as quiet as possible,” city employee Megan Banton told reporters. “We kept hearing the cops saying ‘get down.’”

Twelve people were killed and four others injured when the shooter walked into the building shortly after 4 pm Friday, and “immediately began to indiscriminately fire upon all of the victims,” said Virginia Beach Chief of Police James Cervera. People were found wounded on each of the building’s three floors, and one person was shot in a vehicle outside. The names of the deceased victims were not released pending family notification.

“We were all just terrified. It felt like it wasn’t real, like we were in a dream,” Banton said. “You are just terrified because all you can hear is the gunshots.”

Cervera said the first four cops on the scene “engaged with the suspect,” who had a legally purchased .45-caliber semiautomatic handgun with an attached sound suppressor and extended magazines, enabling him to fire many rounds.

“I can tell you that it was a long gun battle between those four officers and that suspect,” Cervera said.

The police chief refused to name the shooter at Friday’s press conference. News outlets identified him as 40-year-old DeWayne Craddock, a longtime worker at the city’s Public Utilities Department.

Craddock holds a bachelor’s degree in civil engineering from Old Dominion University and previously worked for the Army Training and Support Center and a local manufacturing company, records said.

He joined the Army National Guard after graduating from Denbigh High School in Newport News, Va., according to the Daily Press newspaper.