The Armenian military today demanded the dismissal of top security officials for failing to prevent the assassination Wednesday of the country's prime minister, parliament speaker and six others in an attack by a band of gunmen on the legislative chamber. The attackers surrendered this morning after releasing a number of hostages they had had been holding.

The killing of Prime Minister Vazgen Sarkisian, Speaker Karen Demirchian and the others--including two deputy speakers--led to an overnight standoff at the parliament building between security forces and the five gunmen. The attackers finally agreed to surrender after 16 hours of negotiations, when President Robert Kocharian promised they would get a fair trial and that force would not be used against them.

The gunmen laid down their assault rifles and were taken away in buses, accompanied by armored personnel carriers, to be charged with terrorism. Before they left, however, they recorded a statement that was broadcast on national television. The message complained that "our fair country had been going to pieces in recent years" and "today, we are dragging out a wretched and half-starving existence in it."

The leader of the group was identified as Nairi Unanian, an Armenian nationalist and former journalist who was accompanied in the takeover by a brother, an uncle and two other men. A video camera in the parliament chamber showed them spraying the area with bullets as members scrambled under their desks, but the gunmen's statement said Sarkisian was their only target.

Witnesses said that after fatally shooting Sarkisian, the gunmen called someone on a mobile phone, and one of them said they had killed "the bearded scum."

Unanian said that originally they wanted merely to frighten the legislators by firing into the air, but the statement said they opened fire on other people because they thought they were being shot at by bodyguards. But witnesses contradicted this assertion, saying the gunmen fired randomly around the chamber, which is what they appear to be doing on the videotape from the outset of the attack.

Unanian had once been a member of the radical nationalist Dashnak movement, but the leader of the group, Vagan Oganesian, told reporters today that Unanian was expelled from the organization in 1991 or 1992 and that he was a "nasty" man. "Everybody understood perfectly well that this is a group of rather schizophrenic people," Oganesian said. "Any [legislator] could have made this speech . . . saying that children go to school barefooted and so on. It's just that one must not shoot at people after making such a statement."

Vazgen Manukian, a former prime minister, said it was his impression "that a group of separate individuals decided to accomplish some mission. It does not feel like there were any forces backing them."

The attackers' statement contained no reference to the bitter dispute over the ethnic Armenian region of Nagorno-Karabakh--an enclave surrounded by neighboring Azerbaijan--which was at the center of a war that ended in 1993. Armenia now occupies about 20 percent of Azerbaijani lands, and the enclave has declared its independence from Azerbaijan, though it has not been internationally recognized. Recent high-level talks between Kocharian and Azerbaijani President Gaidar Aliyev have spurred speculation that a joint agreement on the conflict may come soon.

Deputy Secretary of State Strobe Talbott, who left Yerevan just before the attack on parliament Wednesday, arrived today in Moscow for talks with Russian officials about Nagorno-Karabakh and is expected to return to Armenia shortly.

The attack may not ultimately affect efforts to resolve the Nagorno-Karabakh issue, but it seemed certain to slow down Armenian participation. Russian Foreign Minister Igor Ivanov said in Paris that a round of intensified diplomacy may be set back by the assassinations.

Until earlier this year, Sarkisian had been Armenia's defense minister, and the Defense Ministry this morning broadcast a statement calling on Kocharian to dismiss the country's chief prosecutor and the national security and interior ministers, blaming them for the parliament takeover.

The ministry statement declared that the security officials were responsible for "careless negligence" in not preventing the attack, in which the gunmen entered the parliament chamber unhindered. "The absence of control over the security system made it possible," the statement said. While calling for the ouster of these officials, the military pledged fealty to Kocharian.

Former president Levon Ter-Petrossian, who was pressed to resign two years ago after he showed some flexibility on the issue of Nagorno-Karabakh, appealed to Armenians to rally around Kocharian.

The streets of Yerevan were reported to be calm tonight; flags were at half-staff, and a three-day period of national mourning was declared.