VIRGINIA BEACH, Va. (AP) — Police responding to the deadly mass shooting at a Virginia Beach municipal building were unable to confront the gunman at one point because they didn't have the key cards needed to open doors on the second floor.

Over the radio, they desperately pleaded for the electronic cards and talked of bringing in a sledgehammer, an explosive charge or other means of breaking down the doors.

The killer was eventually gunned down, and whether the delay contributed to the toll of 12 victims dead and four wounded is unclear. But the episode last week illustrated how door-lock technology that is supposed to protect people from workplace violence can hamper police and rescue workers in an emergency.

"That's definitely a blind spot that this particular shooting has shown," said Gregory Shaffer, a retired FBI agent and former member of the bureau's elite hostage rescue team. "We need to make sure that first responders have full access to the building."

The attacker, 40-year-old city engineer DeWayne Craddock, went from floor to floor shooting his co-workers in the rampage last Friday before he was finally killed on the second floor in a gun battle with police.

It was not clear how police finally got to Craddock. Virginia Beach police spokeswoman Linda Kuehn said police were unavailable to talk about the matter on Wednesday.

Police Chief James Cervera said the mayhem at the Virginia Beach Municipal Center lasted nearly 36 minutes from the time the gunman started shooting until police took him down.

At about the same time officers were evacuating terrified employees from the third floor, other officers were on the second floor, frantically trying to get to the gunman after he fired at them through doors and walls. On police scanners, officers could be heard becoming exasperated as they tried unsuccessfully to get into locked areas.

"We need access keys. The doors are locked, we need access keys. I know I've got citizens in one area of the second floor I can't evacuate," said one officer.

Key cards have become a standard feature of building security at workplaces around the country. The technology has been used for decades, but it wasn't until after 9/11 that it really began to proliferate, said Tom Manger, a former police chief in Virginia and Maryland and now senior associate director of the Major Cities Chiefs Association.

"It became seen as best practice. And today it is seen by most people as not only best practice but as a necessity," Manger said.

But in many workplaces, security experts say, police often lack quick access to cards or codes — a situation that could cost them precious minutes in a mass shooting. One exception is schools, which have been at the forefront in ensuring that police can quickly get inside with their own key cards or other methods.

Key card technology posed a problem for some of the police officers who responded to a shooting rampage at the Washington Navy Yard in 2013, according to a report by the city's police. Aaron Alexis, a former Navy reservist, killed 12 people before being shot dead in the maze-like, 600,000-square-foot building.

A Washington police officer "had the presence of mind" to take a building access card from a deceased security guard, allowing a team of first responders to get into secure areas, the report said.

Police in some cities have made arrangements to install lock boxes containing key cards or keys outside public and private buildings. But Manger said "there's not enough key cards and lock boxes in the world" to give emergency responders easy access to every building.

"There's no option that's perfect," he said. "You've got to sort of tailor it the building and the situation. But what you can say universally is that this is a conversation and a discussion that needs to happen ahead of time to make sure that first responders can get to a place they need to go."

In the case of the Virginia Beach shooting, the police department and the operations building where the shooting took place were part of the same complex, and police had to run maybe 300 yards to get there. Both the police and the departments inside the building are city agencies.

Shaffer said police are trained to break into buildings and often have the tools to do so, as the radio chatter about sledgehammers and explosives indicated, and he defended the handling of the mass shooting by the Virginia Beach force. He said police "definitely saved lives through their fast response."

"They did exactly what they were supposed to do and ran toward the gunfire," he said.

___

Associated Press writer Regina Garcia Cano in Baltimore and AP researcher Jennifer Farrar in New York contributed to this story.

Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.