"All the hostages got out safely, I don't believe that there is any injuries," the Montgomery County police chief, J Thomas Manger, told reporters at a 5 pm briefing near the building.
The police said the man had been wearing explosive devices. When asked why the police officers shot him, he responded, "based on the information we had, we believed that the hostages' life were in danger."
Police said the suspect had a history with Discovery Communications. A Discovery spokesman, David Leavy, identified the gunman as James Jay Lee.
A website owned by Lee, SaveThePlanetProtest.com, was established in Jan 2008, according to domain name records, and it asserts that Discovery's programming was hurting the environment rather than helping.
Chief Manger said that the suspect had been arrested a couple of years ago demonstrating outside the building.