BESLAN, Russia (AP) _ President Vladimir Putin promised on Saturday a tough response to what he called an ``all-out war'' by terrorists against Russia, as the body count from the school hostage-taking rose to more than 340 dead and some relatives still searched for their loved ones amid the confusion.
A grim-faced Putin addressed the nation on television after a pre-dawn visit to the scene of the hostage-taking in Beslan. In a suprise admission of weakness, he said Russia's past response to terrorism had been insufficient and said he would carry out wide reforms to strengthen the security forces.
``We showed weakness, and weak people are beaten,'' the former KGB spy said.
In Beslan, authorities were counting the dead, and relatives of hostages frantically searched through lists of the names of survivors, a day after security forces stormed the school where militants had been holding more than 1,000 hostages _ mostly women and children _ for nearly three days.
Regional Emergency Situations Minister Boris Dzgoyev said 323 people, including 156 children, were killed in Friday's violence. Russian Deputy Prosecutor Sergei Fridinsky said that all 26 hostage-takers were also killed.
Medical officials said more than 542 people including 336 children were hospitalized after the eruption of violence that ended the 62-hour hostage drama on Friday.
Commandos stormed the school after the militants set off explosions and began shooting at hostages who fled. The result was 10 hours of chaos. Crying children, some naked and covered with blood, fled the scene or were carried out amid explosions and gunfire. Security forces chased militants who split into groups and took refuge in a home and a basement. During the initial explosions, part of the school roof collapsed, causing many deaths.
Putin flew to Beslan, in the southern republic of North Ossetia, before dawn Saturday, as smoke was still rising from the shattered school. He ordered the borders of North Ossetia sealed while security forces search for the militants' accomplices.
He visited several hospitalized victims, stopping to stroke the head of one injured child and the arm of the school principal.
``Even alongside the most cruel attacks of the past, this terrorist act occupies a special place because it was aimed at children,'' he said during a meeting with regional officials, which was broadcast on Russian television.
He stressed that security officials had not planned to storm the school _ trying to fend off any potential criticism that the government side had provoked the bloodshed. Some North Ossetians complained, however, that his visit was too little, too late.
``Why didn't he come earlier? .... Why did he come in the middle of the night?'' said Irina Volgokova, 33, whose close friend and the friend's daughter were missing.
``He is the head of our country. He should answer for this before the people.''
Later, Putin made a speech on national television saying Russia must mobilize to face the threat of terrorism, telling Russians they could not continue living in a ``carefree'' way.
Since the collapse of the Soviet Union, the nation was weakened and unable to respond effectively to terrorism, Putin said.
He blamed police corruption and porous borders for the failure to stop attacks. ``In any case, we couldn't adequately react ... We showed weakness, and weak people are beaten,'' he said.
He said measures would be taken to strengthen Russia's unity, create a more effective crisis management system, establish a new system to control the situation in the Caucasus, and overhaul the law enforcement organs.
The school attack followed a suicide bomb attack outside a Moscow subway station Tuesday that killed eight people, and last week's near-simultaneous crash of two Russian jetliners last week after what officials believe were explosions on board.
The ITAR-Tass news agency quoted an unnamed, high-ranking intelligence official in southern Russia as saying that the school seizure and other major terrorist attacks in Russia had been financed by Abu Omar As-Seyf, an Arab who allegedly represents al-Qaida in Chechnya.
The official said the school raid was masterminded by Chechen rebel leader Shamil Basayev and led by field commander Magomed Yevloyev, who was believed to be the leader of the strict Wahhabi sect of Muslims in Ingushetia, which borders Chechnya.
Nine or ten of the slain hostage-takers were Arabs, Russian officials said. An Arab presence could boost claims of involvement by international militant groups.
Dozens of people crowded around lists of survivors posted at the Beslan hospital Saturday, searching desperately for news of loved ones who were not yet accounted for. A man showed hospital nurses a photograph _ a young boy dressed in a suit, like he was going to a birthday party or holiday celebration.
``We run here, we run there, like we're out of our minds, trying to find out anything we can about them,'' said Tsiada Biazrova, 47, whose neighbors' children had yet to be found.
For some, grief had turned to anger.
``Fathers will bury their children, and after 40 days (the Orthodox Christian mourning period) ... they will take up weapons and seek revenge,'' said Alan Kargiyev, a 20-year-old university student in the regional capital Vladikavkaz.
Russian authorities said the bloody end to the standoff came after explosions apparently set off by the militants _ possibly by accident _ as emergency workers were entering the school to collect the bodies of slain hostages.
As hostages took their chance to flee, the militants opened fire on them, and security forces _ along with town residents who had brought their own weapons _ opened covering fire to help the hostages escape. Commandos stormed into the building and secured it, then chased fleeing militants in the town, with shooting lasting for 10 hours.
Fridinsky, the prosecutor, said the hostage-takers had numbered 26 and all had been killed. The bodies of at least six militants lay outside the school on Saturday, surrounded by black metal and plastic weapons parts and bullets. A forensic investigator studied the bodies.
An explosives expert told NTV television that the militants, themselves strapped with explosives, hung bombs from basketball hoops in the gym and set other explosive devices in the building.
The region's governor, Alexander Dzasokhov, said Friday that the militants had demanded that Russian troops leave Chechnya _ the first solid indication that the attack was connected to the rebellion.
The Federal Security Service chief in North Ossetia, Valery Andreyev, said Saturday that investigators were looking into whether militants had smuggled the explosives and weapons into the school and hidden them during a renovation this summer.
Alla Gadieyeva, a 24-year-old hostage who was seized with her son and mother _ all three were among the survivors _ said the captors laughed when she asked them for water for her mother.
``When children began to faint, they laughed,'' Gadieyeva said. ``They were totally indifferent.''
Two major hostage-taking raids by Chechen rebels outside the war-torn region in the past decade provoked Russian rescue operations that led to many deaths. The seizure of a Moscow theater in 2002 ended after a knockout gas was pumped into the building, debilitating the captors but causing almost all of the 129 hostage deaths.
In 1995, rebels led by guerrilla commander Basayev seized a hospital in the southern Russian city of Budyonnovsk, taking some 2,000 people hostage. The six-day standoff ended with a fierce Russian assault, and some 100 people died.