The overwhelming majority of the victims were students at the army public school, which has children and teenagers in grades 1-10. Pakistani Prime Minister Nawaz Sharif condemned the assault and rushed to Peshawar to show his support for the victims.
The horrific attack, carried out by a relatively small number of militants from the Tehreek-e-Taliban group, a Pakistani militant group trying to overthrow the government, also sent dozens of wounded flooding into local hospitals as terrified parents searched for their children.
"My son was in uniform in the morning. He is in a casket now," wailed one parent, Tahir Ali, as he came to the hospital to collect the body of his 14-year-old son Abdullah. "My son was my dream. My dream has been killed."
The attack began in the morning hours, with about half a dozen gunmen entering the school - and shooting at random, said police officer Javed Khan. Army commandos quickly arrived at the scene and started exchanging fire with the gunmen, he said. Students wearing their green school uniforms could be seen on Pakistani television, fleeing the area.
Details were sketchy in the face of the overwhelming tragedy. Pakistani television showed soldiers surrounding the area and pushing people back. Ambulances streamed from the area to local hospitals.
The information minister for the province, Mushtaq Ghani, said 126 people were killed in the attack. Most of the dead were students, children and teenagers, from the school, he said. Hospital officials said earlier that at least one teacher and a paramilitary soldier were among the dead.
Pervez Khattak, the chief minister of the province where Peshawar is located, said fighting was still underway in some parts of the school.
The prime minister vowed that the country would not be cowed by the violence and that the military would continue with an aggressive operation launched in June in the North Waziristan tribal area to rout militants.
It was not clear how many students and staff remained still inside the facility. A student who escaped and a police official on the scene earlier said that at one point, about 200 students were being held hostage. Both spoke on condition of anonymity because they were not authorized to talk to media.
One of the wounded students, Abdullah Jamal, said that he was with a group of 8th, 9th and 10th graders who were getting first-aid instructions and training with a team of Pakistani army medics when the violence began for real.
When the shooting started, Jamal, who was shot in the leg, said nobody knew what was going on in the first few seconds.
"Then I saw children falling down who were crying and screaming. I also fell down. I learned later that I have got a bullet," he said, speaking from his hospital bed.
Taliban spokesman Mohammed Khurasani claimed responsibility for the attack in a phone call to media, saying that six suicide bombers had carried out the attack in revenge for the killings of Taliban members at the hands of Pakistani authorities. But the chief minister said there were eight attackers, dressed in military uniforms. Two were killed by security forces and one blew himself up, Khattak said. The rest were still fighting.
The Pakistani military spokesman, Asim Bajwa, said on Twitter that five militants had been killed and that security forces had rescued two children and two staff members.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.