Security was tightened at other federal buildings. Senate officials shut down their side of the Capitol. The House remained open.
In the confusion, police said around midday that they were searching for two accomplices who may have taken part in the attack — one carrying a handgun and wearing a tan Navy-style uniform and a beret, the other armed with a long gun and wearing an olive-green uniform. Police said it was unclear if the men were members of the military.
But as the day wore, police dropped one person and then the other as suspects. As tensions eased, Navy Yard employees were gradually released from the complex, and children were let out of their locked-down schools.
Adm. Jonathan Greenert, chief of naval operations, was at the base at the time the shooting began but was moved unharmed to a nearby military installation.
Anxious relatives and friends of those who work at the complex waited to hear from loved ones.
Tech Sgt. David Reyes, who works at Andrews Air Force Base, said he was waiting to pick up his wife, Dina, who was under lockdown in a building next to where the shooting happened. She sent him a text message.
"They are under lockdown because they just don't know," Reyes said. "They have to check every building in there, and they have to check every room and just, of course, a lot of rooms and a lot of buildings."
Associated Press writers Jesse Holland, Stacy A. Anderson, Brian Witte and Ben Nuckols in Washington contributed to this report.