Charles Dharapak, Associated Press
Donna Jones-Reilly of Gaithersburg, Md., a Hillary Rodham Clinton supporter, bows her head in prayer in Vienna, Va., on Friday during a hostage situation.

ROCHESTER, N.H. — A distraught man wearing what appeared to be a bomb walked into a Hillary Rodham Clinton campaign office Friday and demanded to speak to the candidate during a hostage drama that dragged on for nearly six hours before he peacefully surrendered.

Shortly after releasing the last of at least four hostages unharmed, 47-year-old Leeland Eisenberg walked out of the storefront office, put down a homemade bomblike package and was immediately surrounded by SWAT team with guns drawn. He was put on the ground and handcuffed.

Clinton was in the Washington area the whole time, but the confrontation brought her campaign to a standstill just five weeks before the New Hampshire primary, one of the first tests of the presidential campaign season. She canceled all appearances, as did her husband, former President Bill Clinton, and the security around her was increased as a precaution.

"Everything stopped, and it had to because we had nothing on our minds except the safety of these young people who work for me," Clinton told reporters shortly after the standoff ended. She said she was "just relieved to have this situation end so peacefully" and that she was headed to New Hampshire to thank law enforcement officials.

According to police, the drama began shortly before 1 p.m., when the man walked into the office and peeled back his jacket to reveal what appeared to be a bomb duct-taped to his chest. He took several hostages but let a woman with an infant go immediately. At least one other woman got out about two hours later.

Seconds before he surrendered, shortly after 6 p.m., the last hostage walked from the office. The hostage then ran down the street toward the police roadblocks surrounding Clinton's office.

Not long after the surrender, police maneuvered a robot to the hostage-taker's package and triggered an explosion to destroy it.

Witness Lettie Tzizik told television station WMUR of Manchester that she spoke to the woman who was released first and that she was crying, holding the infant.

"She said, 'You need to call 911. A man has just walked into the Clinton office, opened his coat and showed us a bomb strapped to his chest with duct tape," Tzizik said.

Heavily armed SWAT team members, protecting themselves with shields, called to the man over bullhorns and attempted to hand a phone into the office.

CNN reported after Eisenberg surrendered that a woman had called the network from the office and put Eisenberg on the phone. He told CNN he had mental problems and couldn't get anyone to help him, and called the network several times during the standoff.

CNN's Wolf Blitzer said the network called police after hearing from Eisenberg, but did not air those details until Eisenberg surrendered out of concern for the hostages' safety.

A law enforcement official confirmed to The Associated Press earlier that the suspect's name was Leeland Eisenberg, and that he was known around the town to be mentally unstable. The official declined to be identified because he was not authorized to speak publicly about the case.

The official said the man walked into the campaign office and opened his jacket, revealing what appeared to be a pipe bomb, and that he demanded to speak with Clinton. Authorities did not know what Eisenberg wanted to talk to Clinton about.

They believe the device strapped to the man's chest was made with road flares, not a bomb, the official said.

The office, in a town of 30,000, is one of many Clinton has around New Hampshire. The campaign said the people taken hostage were volunteers for the campaign.

Eisenberg walked into the office about a half-hour before he was scheduled to appear in Strafford County court with his wife for a domestic violence hearing, according to Foster's Daily Democrat in Dover.

Divorce papers filed Tuesday indicated Eisenberg was arrested and charged with criminal mischief, domestic related, and violation of a protective order. In the papers, Eisenberg's wife said the divorce was a result irreconcilable differences and complained that he suffered from "severe alcohol and drug abuse, several verbal abuse and threats."

Eisenberg also was arrested at least twice earlier this year, once for allegedly driving under the influence and once on two counts of stalking. The status of those cases was not immediately clear.

Eisenberg made local headlines in March when he held a news conference on the steps of Rochester City Hall to complain about a police policy of placing fliers in unlocked cars warning motorists to lock their doors.

"This is nothing more than a gimmick to get around the Constitution and go around in the middle of the night upon unsuspecting citizens in their own yard and search their vehicles," Eisenberg said.

Police, who said they were just trying to reduce theft from motor vehicles, changed the policy in response.