A longtime employee opened fire at a local government building in the US state of Virginia, killing 11 people before police fatally shot him, authorities have said.

Six other people were wounded in the shooting, including a police officer whose bulletproof vest saved his life, said Virginia Beach Police Chief James Cervera.

The shooting happened shortly after 4pm local time (9pm BST) when the employee of the Public Utilities Department entered a building at the Virginia Beach Municipal Centre, and “immediately began to indiscriminately fire upon all of the victims,” Mr Cervera said.

He did not release the suspect’s name.

Active Shooter-Virginia BeachPolice at the scene where 11 people were killed during a mass shooting in Virginia Beach (L Todd Spencer/The Virginian-Pilot via AP)

Police entered the building and got out as many employees as they could, then exchanged fire with the suspect, who was killed, the chief said.

The shooting sent shock waves through Virginia Beach, the state’s largest city and a popular holiday spot in south-eastern Virginia.

But the building where the attack took place is in a suburban area miles away from the high-rise hotels along the beach and the business area.

“This is the most devastating day in the history of Virginia Beach,” mayor Bobby Dyer said.

Megan Banton, an administrative assistant who works in the building where the shooting happened, said she heard gunshots, called the police and barricaded a door.

“We tried to do everything we could to keep everybody safe,” she said.

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

She said she texted her mother, telling her that there was an active gunman in the building and she and others were waiting for police.

Ms Banton works in an office of about 20 people that is part of the public works department.

“Thank God my baby is OK,” Ms Banton’s mother, Dana Showers, said.

Five patients were being treated at Sentara Virginia Beach General Hospital and a sixth was being transferred to the Trauma Centre at Sentara Norfolk General Hospital, Sentara Healthcare tweeted.

Paul Swain, 50, was among those who arrived at the Princess Anne Middle School to reunite with loved ones who were in the building during the shooting.

He said he saw his fiancee from across the car park, clearly in an agitated state.

“I think she knew some of the people,” he said.