"Four people were killed and eight injured," Capt Ed Buclatin, director of public affairs at the Navy Installations Command at the Navy Yard, wrote on Twitter.
"We believe there has been loss of life and several injuries," Pentagon press secretary George Little said.
Two law enforcement officials were among the killed.
Both the shooters were shot down.
The facility was immediately locked down.
More From This Section
Police spokesman Chris Kelly described the suspect as an adult male, about six feet tall with a bald head and medium complexion, dressed in a black top and black jeans.
Security agents have rushed to scene of firing. A US Park Police helicopter hovered over a building and appeared to drop a basket or a stretcher with a person onto the roof.
Dozens of emergency vehicles have converged on the site.
Nearly 3,000 people work at the command, which engineers, purchases, builds and maintains ships and submarines for the US Navy.
President Barack Obama has been briefed on the matter, the White House said.
Obama directed his team to stay in touch with federal partners, including the Navy and FBI, as well as the local officials.
"We urge citizens to listen to the authorities and follow directions from the first responders on site," the White House official said.
The incident is reported to have happened at about 8:20 am when several shots were fired inside the headquarters for Naval Sea Systems Commands in southeast Washington.