About 3,000 people work at the headquarters, many of them civilians.
Witnesses described a gunman opening fire from a fourth-floor overlook, aiming down on people in the cafeteria on the main floor. Others said a gunman fired at them in a third-floor hallway. It was not clear whether the witnesses on different floors were describing the same gunman.
Around midday, police said they were searching for two men 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. Washington Police Chief Cathy Lanier said it was unclear if the men were members of the military.
But later in the day, police said in a tweet that the man in the tan uniform had been identified and was not involved in the shooting.
It was not immediately clear whether the number of dead included a gunman.
As emergency vehicles and law enforcement officers flooded streets around the complex, a helicopter hovered overhead, nearby schools were locked down and airplanes at nearby Reagan National Airport were grounded so they would not interfere with law-enforcement choppers.
A short distance away, security was beefed up at the Capitol and other federal buildings, but officials said there was no known threat.
Todd Brundidge, an executive assistant with Navy Sea Systems Command, said he and other co-workers encountered a gunman in a long hallway on the third floor. The gunman was wearing all blue, he said.
"He just turned and started firing," Brundidge said.
Terrie Durham, an executive assistant with the same agency, said she also saw the gunman firing toward her and Brundidge.
"He aimed high and missed," she said. "He said nothing. As soon as I realized he was shooting, we just said, 'Get out of the building.'"