"We just heard people yelling and screaming at people to get down," Megan Banton, an administrative assistant in the building, told local television news station WAVY.
Another employee told the AP news agency she and others heard shooting, but did not think the gunfire was close.
Image copyrightREUTERSImage captionThe shooting was at Building 2 in Virginia Beach Municipal Center
"I just thank god they were able to alert us in time, because if it had been 10 minutes more we would have all been outside," Sheila Cook said.
Police Chief James Cervera said the gunman returned fire on police officers at the scene and was killed in the exchange.
Police said they believed the gunman had acted alone.
What is known about the victims?
The identities of the 11 people killed were not released by authorities.
At least six people are known to have been wounded, including a police officer, but the severity of their injuries remained unclear.
The injured officer's life was saved when a bullet struck his vest, Chief Cervera told reporters.
A White House spokesman said President Trump had been briefed about the shooting.
The FBI was at the scene helping local authorities investigate the shooting, US media reported.
Virginia Beach is the state's most populous city - with about 440,000 residents.
What has the reaction been?
Virginia Senator Tim Kaine said on Twitter he was "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," he said.
Robert Dyer, the city's mayor, said: "This is the most devastating day in the history of Virginia Beach.
Virginia governor Ralph Northam described the incident as a "tragic day" for the city and the state.
"My heart breaks for the victims of this devastating shooting, their families, and all who loved them," he said on Twitter. "I am on my way to Virginia Beach now and will be there within the hour."
According to US tracking website Gun Violence Archive, the incident is the 150th mass shooting in the US so far in 2019.
警方一日公布,凶嫌為四十歲的克萊杜克(DeWayne Antonio Craddock),他已在市府服務十五年,犯案動機仍待調查。華爾街日報報導,克萊杜克最近遭開除,但當局並未證實。維吉尼亞灘市警察首長塞維拉(James Cervera)上月卅一日曾說,歹徒是名「心懷不滿」的資深員工。媒體指克萊杜克曾服役於陸軍國民兵,無不良紀錄,獨來獨往、身材健壯。