Media playback is unsupported on your device Media caption Police chief Thomas Manger: "There are other suspected devices in the building"

A gunman who took three hostages at the Discovery Communications headquarters in the US has been shot dead by police and his captives have been set free.

The man had canisters strapped to his chest and a handgun when he entered the building near Washington DC, police said.

Officers opened fire because they thought the gunman was about to detonate his explosives, they added.

The police had held several hours of talks with the man.

Discovery employees were evacuated from the building shortly after the incident began at about 1700 GMT.

The area around the building in Silver Spring, Maryland, was sealed off as police negotiated with the man. After several hours, police began to fear for the safety of the hostages, said Montgomery County Police Chief J Thomas Manger.

He said a man had entered the Discovery headquarters through the main entrance wearing what appeared to be "metallic canisters" on his clothes.

The man then pulled out a handgun and told everyone to remain still.

Image caption Discovery Channel headquarters is located in Silver Spring, Maryland, just outside Washington DC

Unnamed police officials quoted by the US media named the gunman as James Jay Lee, a man in his 40s known for protesting outside the building.

The US broadcaster NBC reported that one of their producers had a brief telephone conversation with the gunman while he was holding the hostages.

The man came on the line unexpectedly when the journalist called the Discovery Communications building to find out what was going on.

NBC reported that the gunman identified himself as James J Lee and said: "I have a gun and I have a bomb. I have several bombs strapped to my body ready to go off."

Demands

A man called James Lee of San Diego, California, was arrested outside Discovery's headquarters in 2008 after throwing thousands of dollars into the air in protest against the network, according to The Gazette, a local newspaper.

Mr Lee said he threw the money because Discovery's programming had little to do with saving the planet.

He reportedly was also the author of the website savetheplanetprotest.com, where he demanded that the Discovery Channel broadcast programmes that would help "to save the planet".

A spokesman for Discovery Communications said the company had known the gunman before this incident but "not taken his threats or demands seriously".

Discovery Communications reaches 1.5bn subscribers in 180 countries through networks like Discovery Channel, Animal Planet, and the Science Channel.