More than eight hours after militants slipped into the heavily guarded compound through a back entrance, the army declared the operation to flush them out over, and said that all nine insurgents had been killed. Peshawar attack: As it happened Fight against terrorism will continue: Nawaz Sharif Nobel prize winner Malala "heartbroken" by Pakistan school attack India strongly condemns Peshawar school attack
The attack on a military-run high school attended by more than 1,100 people, many of them children of army personnel, struck at the heart of Pakistan's military establishment, an assault certain to enrage the country's powerful army.
Wounded children taken to nearby hospitals told Reuters most victims died when gunmen, suicide vests strapped to their bodies, entered the compound and opened fire indiscriminately on boys, girls and their teachers.
"One of my teachers was crying, she was shot in the hand and she was crying in pain," said Shahrukh Khan, 15, who was shot in both legs but survived after hiding under a bench.
"One terrorist then walked up to her and started shooting her until she stopped making any sound. All around me my friends were lying injured and dead."
The Taliban, waging war against Pakistan in order to topple the government and set up an Islamic state, immediately claimed responsibility.
"We selected the army's school for the attack because the government is targeting our families and females," said Taliban spokesman Muhammad Umar Khorasani. "We want them to feel the pain."
As night fell on Peshawar, a teeming, volatile city near the Afghan border, security forces wrapped up an operation that lasted more than eight hours and involved intense gun battles. The military said about 960 pupils and staff were evacuated.
The Taliban said the gunmen had been equipped with suicide vests and at least three explosions were heard inside the high school at the height of the massacre.
Outside, as helicopters rumbled overhead, police struggled to hold back distraught parents who were trying to break past a security cordon and get into the school.
Officials said 121 pupils and three staff members were wounded. A local hospital said the dead and injured were aged from 10 to 20 years old.
A correspondent visiting the city's major Combined Military Hospital said its corridors were lined with dead students, their green-and-yellow school uniform ties peeping out of the white body bags.
The gunmen, who several students said communicated with each other in a foreign language, possibly Arabic, managed to slip past the school's tight security because at least some of them were wearing Pakistani military uniforms, some witnesses said.
Pakistanis, used to almost daily militant attacks, were shocked by the scale of the massacre and the loss of so many young lives. It recalled the 2004 siege of a school in Russia's Beslan by Chechen militants which ended in the death of more than 330 people, half of them children.
The United States, Pakistan's ally in their fight against Islamist militants operating in Pakistan and Afghanistan, swiftly condemned the attack.
"This act of terror angers and shakes all people of conscience ... the perpetrators must be brought to justice," said U.S. Secretary of State John Kerry.
SPIRAL OF VIOLENCE
The Pakistani Taliban have vowed to step up attacks in response to a major army operation against the insurgents in the tribal areas.
But despite the crackdown this year, the military has long been accused of being too lenient towards Islamist militants who critics say are used to carry out the army's bidding in places like Kashmir and Afghanistan.
The military denies the accusations.
So far the Taliban have targeted mainly security forces, military bases and airports, but attacks on civilian targets with no logistical significance are relatively rare.
In September, 2013, however, dozens of people, including many children, were killed in an attack on a church, also in Peshawar in Pakistan's northwest.
The assault on a school where officers' children studied could push the armed forces into a more drastic response, analysts said.
Army chief Raheel Sharif's first public remarks after the attack reflected rising anger.
"These terrorists have struck the heart of the nation. But our resolve to tackle this menace has gotten a new lease of life. We will pursue these monsters and their facilitators until they are eliminated for good," he said.
Prime Minister Nawaz Sharif used similarly strong words.
"We will take revenge for each and every drop of our children's blood that was spilt today," he said.
In India, Pakistan's long-time rival, Prime Minister Narendra Modi expressed his shock.
Pakistani teenager Malala Yousafzai, joint winner of this year's Nobel peace prize for education campaign work and survivor of a Taliban attack in 2012, said she was devastated.
"I am heartbroken by this senseless and cold-blooded act of terror in Peshawar that is unfolding before us," Malala, who now lives in central England, said in a statement.
More than eight hours after militants slipped into the heavily guarded compound through a back entrance, the army declared the operation to flush them out over, and said that all nine insurgents had been killed.
Peshawar attack: As it happened
Fight against terrorism will continue: Nawaz Sharif
Nobel prize winner Malala "heartbroken" by Pakistan school attack
India strongly condemns Peshawar school attack