Virginia Beach police say the suspect, who opened fire at the city's municipal centre, was a longtime current municipal employee and described him as "disgruntled." The shooting is the 150th mass shooting in the US this year.
A longtime public utilities employee sprayed gunfire "indiscriminately" in a government building complex on Friday in Virginia Beach, in the US state of Virginia, killing 12 people and injuring four others, police said.
All but one of the victims from the mass shooting in the coastal resort community were employed by the city, officials said at a news conference, while the other was a contractor seeking a permit. Four people were wounded.
The gunman, DeWayne Craddock, had worked for the city's public utilities department for about 15 years, Virginia Beach Police Chief James Cervera said at a news conference.
The gunman was also killed after trading fire with responding officers Cervera told a news conference.
Cervera has said he will only give the gunman's name once because city authorities want to focus on his victims.
The shooting happened just after 4:00 pm local time (2000 GMT), when the gunman entered one of the buildings at the Virginia Beach municipal complex and "immediately began to indiscriminately fire on all of the victims," Cervera said.
The wounded included a police officer, who was saved by his bulletproof vest.
"This is the most devastating day in the history of Virginia Beach," Mayor Bobby Dwyer told reporters. "The people involved are our friends, co-workers, neighbours and colleagues."
TRT World's Lionel Donovan reports.
The building where the shooting took place in Virginia Beach, a city on the east coast of the US about 320 kilometres (200 miles) southeast of Washington, housed the city's public works and utilities offices.
Multiple law enforcement agencies including the FBI were working the scene Friday night due to its "size, scope, intensity," Cervera said.
"Right now we have a lot of questions. The whys, they will come later. Right now we have more questions than we have answers."
According to the Washington-based Gun Violence Archive monitoring group, Friday's shooting was the 150th mass shooting in the United States this year, defined as a single event in which four or more people are shot or killed.
Despite the scale of gun violence across the nation, gun ownership laws are lax and efforts to address the issue legislatively have long been deadlocked at the federal level.
Megan Blanton told The Virginian-Pilot newspaper that she was in the building when the shooting began. She and several co-workers hid in an office, where they used a desk to wedge the door shut.
"It felt like forever," Blanton said.
Virginia Governor Ralph Northam called it "just a horrific day."
"Our thoughts are for the victims and families. We're working with our law enforcement, first responders, our folks at the hospital and just making sure we take care of everybody right now," he said as he prepared to enter a briefing on the situation.
Added Virginia Senator Tim Kaine: "I'm devastated to learn of the tragic shooting tonight in Virginia Beach. My heart is with everyone who lost a loved one, and I'm praying for a swift recovery for all those who have been injured."
Singer and music producer Pharrell Williams, a native of Virginia Beach, paid homage to the strength of his hometown.
"We are praying for our city, the lives that were lost, their families and everyone affected. We are resilient," he said in a tweet.
"We will not only get through this but we'll come out of this stronger than before we always do."