BLOODY END TO RUSSIA SCHOOL SIEGE
Some reports say all the hostages have now been brought out of the school, but there are continuing scenes of chaos.
Heavy gunfire and loud explosions were heard as ambulances rushed scores of casualties to nearby hospitals.
Unconfirmed reports say that at least 10 people have been killed and up to 200 wounded.
Several of the hostage takers are also reported to have died in exchanges of fire with troops as they tried to escape, Reuters reports.
Some are reported to have blown themselves up, but others appear to have got away, says the BBC's Jonathan Charles.
Correspondents say many of those released were desperate for water when they came out, and some were barely able to stand.
A large number of people had earlier been seen fleeing the premises, many of them covered in blood.
Helicopters hovered overhead and there were troops everywhere.
Sarah Rainsford says a man who had been inside the building told her there had been an explosion and a wall had collapsed. This had been followed by gunfire and many more explosions.
It is unclear what caused the initial explosion.
There is pandemonium in the streets surrounding the school, says the BBC's Damian Grammaticas, who is also at the scene.
On Thursday, 26 women and young children were released, and some of them provided the first details of conditions inside the school.
"You know there are not 300 people in there, but altogether 1,500. People are lying on top of each other," 27-year-old teacher Zalina Dzandarova told the Kommersant newspaper.
Officials put the number of hostages at 354 before Thursday's release, although the school has more than 1,000 pupils.
Trip wires were believed to have been laid around the school, with the attackers threatening to blow it up if it was stormed by police.
Hundreds of relatives of those being held inside the school who had been waiting anxiously outside the security cordon reacted in panic to the outbreak of fighting.
Officials said the release of the 26 people on Thursday came after mediation efforts by the former President of the neighbouring region of Ingushetia, Ruslan Aushev.
The attackers - both men and women, some wearing bomb belts - struck on Wednesday, the first day of the new school year in Russia.
Many parents and other relatives were inside the school, helping their children celebrate the new year, when the assault began.