WASHINGTON � A man who railed against the Discovery Channel's environmental programming for years burst into the company's headquarters with at least one explosive device strapped to his body Wednesday and took three people hostage at gunpoint before police shot him to death, officials said.

The hostages � two Discovery Communications employees and a security guard � were unhurt after the four-hour standoff. Montgomery County Police Chief Thomas Manger said tactical officers moved in after officers monitoring Lee on building security cameras saw him pull out a handgun and point it at a hostage.

An explosive device on the gunman's body detonated when police shot him, Manger said. Police were trying to determine whether two boxes and two backpacks the gunman had also contained explosives.

A law enforcement official speaking on condition of anonymity because the investigation was ongoing said authorities had identified James J. Lee as the likely suspect.

County Police and firefighters Wednesday night looked at a laptop screen that showed an image of a body lying face-up, surrounded by blood. Authorities also sent in a robot to disarm the explosive on the gunman's body.

NBC News reported that after its producers called Discovery's general number, a man identifying himself as James J. Lee got on the phone and said he had a gun and several bombs.

"I have several bombs strapped to my body ready to go off. I have a device that if I drop it, if I drop it, it will ... explode," the man told NBC.

He said he built the bombs in about three weeks. "I did a lot of research. I had to experiment," he said.

Manger said the suspect held the hostages in the lobby area of the first floor. Authorities said they will methodically go through the building and identify any suspicious items.

The "building is still a crime scene," Manger said. "We still have work to do."

Manger said police spent several hours negotiating with the armed man after he entered the suburban Washington building about 1 p.m. None of the 1,900 people who work in the building were hurt, and most made it out before the standoff ended.

Lee was convicted of disorderly conduct for a protest he organized outside Discovery's offices in February 2008. According to court records, he paid homeless people to carry signs and set off a scramble when he threw fistfuls of cash into the air, calling it "just trash."

Lee served two weeks in jail after his arrest during which doctors evaluated his competency to stand trial. County State's Attorney John McCarthy said Lee was ordered to stay 500 feet away from Discovery headquarters as part of his probation, which ended two weeks ago. A magistrate ordered a doctor's evaluation, but the result was not immediately available Wednesday.

"The Discovery Channel produces many so-called Environmental Programs' supposedly there to save the planet," Lee said in an ad he took out in a Washington newspaper to promote the protest. "But the truth is things are getting WORSE! Their programs are causing more harm than good."

In court and online, Lee faulted the Discovery Channel for shows as varied as "Future Weapons," "It Takes a Thief" and "Planet Green."

A lengthy posting that could be seen Wednesday on a website registered to Lee said Discovery and its affiliates should stop "encouraging the birth of any more parasitic human infants," a possible reference to shows like "Kate Plus 8" and "19 Kids and Counting." Instead, he said, the network should air "programs encouraging human sterilization and infertility."

Discovery Communications Inc. operates U.S. cable and satellite networks including The Discovery Channel, TLC and Animal Planet. Discovery shows include "Cash Cab" and "Man vs. Wild," and TLC airs "American Chopper" and "Kate Plus 8."

David Leavy, Discovery's executive vice president for corporate affairs, said all employees had been accounted for. "We're relieved that it ended without any harm to our employees," he said.

Melissa Shepard, 32, of Peterborough, N.H., a consultant who works in the building, said she was on the third floor with several other workers when someone announced over a loudspeaker that there was a situation in the lobby and people should stay at their desks.

After some time, they were told to move to the other end of the building. She said she was among a dozen workers who went into an office, shut the door and turned off the lights.

Then she said someone knocked on the door and told them to leave the building. She said there was some confusion as they were told to go to an upper floor or down the stairs.

"Finally, I screamed, Tell us where we need to go! ... I just want to get out of there,'" she said. "I was shaking. ... I was like, What do we do? What do we do?'"

Adam Dolan, a sales director in Discovery's education division, said that when he got to the bottom floor he saw shattered glass near the company's day-care center and suspected it was broken to get the children out. He later got an e-mail saying 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.

Leavy said Discovery hopes and expects to be open Thursday. "The priority is going to be nurturing and responding to employee needs over the coming days as this is a scary event," he said.

Discovery officials are familiar with the suspect and his past protest at the building, Leavy said. At Lee's trial, he said he began working to save the planet after being laid off from his job in San Diego. He said he was inspired by "Ishmael," a novel by environmentalist Daniel Quinn, and by former Vice President Al Gore's documentary "An Inconvenient Truth."

Quinn told The Associated Press from his home in Houston that he found out about the standoff in Maryland from the media. Just a few hours later, he said he was feeling "a bit ragged" after getting calls from reporters across the country.

He said he had never heard of Lee and was stunned that Lee's manifesto advocated things like human sterilization and an end to farming, ideas Quinn said he would never support.

"He wants to get more exposure ... and he thinks that he can get it ... by occupying Discovery," Quinn said. He added that if he could talk to Lee, he would tell him "he's giving a bad name to the ideas that he's trying to espouse."