Dozens of emergency vehicles converged on the site as news of the shooting emerged. @BBC
A gunman who died after killing 12 people at a naval installation in Washington DC has been identified as a former Navy serviceman.
Aaron Alexis, 34, of Fort Worth, Texas, died in a gun battle with police during the rampage at Washington Navy Yard.
Eight others were injured in the attack, which began at around 8:20 local time (12:20 GMT) on Monday.
US President Barack Obama ordered flags be lowered to half mast at the White House and Capitol Hill.
He said he mourned "yet another mass shooting" and condemned the "cowardly act".
'Complete shock'
No motive is known for the attack, whose dozen victims ranged in age from 46-73, said the authorities.
Police initially responded to reports of two other armed suspects, but after exhaustive searches Washington Police Chief Cathy Lanier said on Monday night they were all but certain that Alexis was the only gunman.
Witnesses said the suspect sprayed bullets in a hallway and fired from a balcony down on to workers in an atrium at the heavily secured installation in the US capital.
He was reportedly armed with an AR-15 semi-automatic rifle, a shotgun and a handgun that he took from a police officer at the scene.
Chief Lanier told reporters that the attacker "was engaged in shooting with police officers" when he died. "There is no question he would have kept shooting," she added.
Valerie Parlave of the FBI said that the suspect, who was employed by a subcontractor that was working on a US Navy intranet network, had a valid pass to enter Washington Navy Yard.
Alexis was formerly a petty officer 3rd class who served full-time in the naval reserve from 2007-11, said the US Navy.
It was not immediately clear why he left the military, but unnamed military officers told US media there had been a series of misconduct issues during his service.
Awarded National Defense Service medal, and Global War on Terrorism Service medal
According to media reports, Alexis was a Buddhist convert who had two previous gun-related brushes with the law.
In 2004 he was arrested in Seattle for shooting a construction worker's car tyres, in what he described as an enraged "black-out".
And he was questioned by Fort Worth police in 2010 after firing his gun through the floor of an upstairs apartment, but he said it was an accidental discharge.
One police officer was shot in the legs, a female civilian was shot in the head and hand, and another woman was treated for a shoulder wound.
All three were expected to recover, said Washington Hospital Center officials.
Five others had required medical treatment, mostly for minor injuries, said Washington DC Mayor Vincent Gray.
As news of the shooting emerged, emergency vehicles and police surrounded the complex, while helicopters hovered overhead.
The US Senate buildings and six nearby schools were temporarily placed on lockdown as a precaution, while flight departures were briefly suspended at Reagan National Airport.
Patricia Ward, who works at Washington Navy Yard, said she had heard three shots, a pause, and then four more.
"Everybody was panicking and trying to decide which way to get out," she told reporters.
The Washington Nationals baseball team called off their game against the Atlanta Braves on Monday night at Nationals Park, not far from Navy Yard.
And as the city remained jittery into Monday evening, agents sealed off the area in front of the White House when a man threw firecrackers over a perimeter fence. He was arrested.
Monday's mass shooting occurred at a building that serves as the headquarters for the Naval Sea Systems Command, which builds and maintains ships and submarines for the Navy.
Washington Navy Yard is the US Navy's oldest shore installation, first opened in the early 19th Century, according to the Navy.