The Census Bureau confirmed on Twitter that there had been "an incident at the Suitland Federal Center and there is an ongoing investigation."
Suitland is in Maryland and the suspect later fled to Washington.
The guard was in extremely critical condition after being shot at least once in his upper body at the Census Bureau's suburban Washington headquarters in Suitland, Maryland, Prince George's County Fire Department spokesman Mark Brady told the Washington Post.
The guard later died, the Post said, quoting a hospital official.
A chase and shootout ensued and the suspect was later shot in the head in Washington's popular H Street neighborhood known for its nightlife, the Post reported.
The Post quoted police as saying the suspect was still alive.