A hostage-taking at the Discovery Channel network headquarters near Washington, D.C, ended after four hours on Wednesday when police shot and killed the gunman.
Montgomery County Police Chief Thomas Manger said three hostages — two employees and a security guard — were safe and out of the building.
Manger said police tried to negotiate with the gunman, who had an explosive device strapped to his body, but they ultimately shot him when they saw him point a handgun at a hostage.
When the gunman, identified as James Lee, 43, was shot, the explosives detonated.
Police described the gunman as having "concerns" with Discovery's programming, but would not elaborate. The concerns appear to be of an environmental nature.
A website on which Lee aired his grievances was registered in Burnaby, B.C., but there is no confirmation that Lee is Canadian.
Lee had been convicted of disorderly conduct after he protested outside Discovery's offices in February 2008.
The gunman burst into the suburban Washington building about 1 p.m. ET wearing what appeared to be metal canisters strapped to his front and back and waving a handgun, police said. At least three bomb technicians responded to the building, and police said the gunman was being monitored on closed-circuit TV.
Montgomery County Police Capt. Paul Starks would not say whether the gunman had ever worked for Discovery Communications.
Manger said most of the 1,900 people who work in the building were able to get out safely.
"We're relieved that it ended without any harm to our employees," said David Leavy, Discovery's executive vice-president for corporate affairs.
'Everyone was very scared'
Adam Dolan, a sales director in Discovery's education division, said he was heading to lunch with a co-worker when he heard there was a situation in the building.
He was told to go back up to the top floor, the ninth, lock the door and turn off the lights. Eventually the workers were herded down a stairwell and told to go home.
"Everyone was very scared, but at the same time … I think people were calm and collected and responded as one would expect in this situation," said Dolan, 28.
When he got to the bottom floor, he saw shattered glass near the company's daycare; he said he suspected it was broken to get the children out. He later got an email that all the children were safe and had been taken to a McDonald's.
Dolan said the company has unarmed security guards who won't let anyone into the building without a badge.
Police evacuated the building, asked people in nearby buildings to stay inside and blocked off surrounding streets, he said. FBI officials and agents from the bureau of Alcohol, Tobacco, Firearms and Explosives also said they were responding.
Discovery operates cable and satellite networks in the U.S., including The Discovery Channel, TLC and Animal Planet.
Discovery shows include Cash Cab and Man vs. Wild, and TLC airs American Chopper, Kate Plus 8 and 19 Kids and Counting.
Animal Planet also airs the controversial series Whale Wars, about attempts by environmentalists to disrupt the Japanese whaling industry.