STORY HIGHLIGHTS
- Pakistan lifts moratorium on the death penalty after massacre
- Of the 145 people killed, most were children between ages 12 and 16
- Attackers gunned down students hiding under benches
- "A lot of the children are under the benches. Kill them," an attacker said
Islamabad, Pakistan (CNN) -- As Pakistan started three days of national mourning Wednesday, the Taliban said they targeted a school that mostly admits soldiers' children because the students aspired to follow in their fathers' footsteps and target militants.
Terrorists ambushed the school in Peshawar on Tuesday, explosives strapped to their bodies, and burst into an auditorium filled with students taking exams.
They sprayed bullets rapidly, killing 145 people. Of those, 132 were children, authorities said.
In an email, the terror group warned Muslims to avoid places with military ties, saying it attacked the school to avenge the deaths of children allegedly killed by soldiers in tribal areas.
It accused the students at the army school of "following the path of their fathers and brothers to take part in the fight against the tribesmen" nationwide.
The Army Public School and Degree College is home to about 1,100 students and staff, most of them sons and daughters of army personnel from around Peshawar. The public school admits children whose parents are in the military, but its classes are not restricted to future soldiers.
A day after the massacre, Pakistani Prime Minister Nawaz Sharif lifted a moratorium on the death penalty for terrorism cases.
Who are the Pakistani Taliban?
'Under the benches ... kill them'
Student Ahmed Faraz, 14, recalled the moment the terrorists struck. He was in the auditorium when about five people burst in through a back door and started firing.
" 'God is great,' " the militants shouted as they roared through the hallways, Ahmed said.
They sought out terrified children.
" 'A lot of the children are under the benches,' " a Pakistan Taliban member said, according to Ahmed. " 'Kill them.' "
The ninth-grader got shot in his left shoulder and lay under a bench.
"My shoulder was peeking out of the bench," Ahmed recalled. "They went into another room, (and when) I ran to the exit, I fell."
Seventh-grader Mohammad Bilal said he was sitting outside his classroom taking a math test when the gunfire erupted. He fell into bushes before running to the school's gates to safety.
Students, teachers recount the horror they saw
Children drenched in blood
Pakistani troops eventually pushed through the buildings, room by room, and confined the attackers to four buildings.
They found children drenched in blood. Some of the bodies lay on top of others.
"Even the children are dying on the frontline in the war against terror," said Khawaja Asif, the defense minister. "The smaller the coffin, the heavier it is to carry."
By the time the siege ended in the evening, military officials said all seven militants were dead. It's unclear whether they were killed by soldiers or they detonated their explosives. The casualty tolls don't include the terrorists.
The ambush at Army Public School and Degree College left more than 100 injured, many with gunshot wounds, according to Mushtaq Ghani, a spokesman for Khyber Pakhtunkhwa province.
It started with a ruse
The nightmare began in late morning, when a car exploded behind the school. Pakistani authorities said the blast was a ruse to divert security guards' attention.
Gunmen got over the walls and walked through where students in grades eight, nine and 10 have classes.
The militants came in with enough ammunition and other supplies to last for days and were not expecting to come out alive, a Pakistani military official said.
Most of those killed were between the ages of 12 and 16, said Pervez Khattak, chief minister of Khyber Pakhtunkhwa province, of which Peshawar is the capital.
Some adults were also targeted, including a 28-year-old office assistant who was shot and burned alive, police official Faisal Shehzad said.
Goal was to kill
Pakistani authorities said the attackers' goal was to kill, not take captives.
While lifting a moratorium on the death penalty in terror cases, the Prime Minister expressed frustration about failed talks.
"We tried dialogue with these militants, we reopened the door to talks," Sharif said. "It was unsuccessful ... there was no other option than to engage in an operation against these people."
He did not mention any specific terror groups. But the Pakistan Taliban and the government have been involved in peace talks in the past. Pakistan released 19 Taliban noncombatants in a goodwill gesture, but talks broke down after a wave of militant attacks.
Violent past
Pakistan has seen plenty of violence, much of it involving militants targeting restive regions in northwest Pakistan along the border with Afghanistan.
It is the home base of the Pakistan Taliban, known as the Tehreek e Taliban Pakistan or TTP, which seeks to enforce its conservative version of Islam in Pakistan. The group has battled Pakistani troops and attacked civilians, including in Peshawar, an ancient city of more than 3 million people.
And the Taliban haven't hesitated to go after schoolchildren. Their most notable target is Malala Yousafzai, who was singled out and shot in October 2012 as she rode to school in a van with other girls. The teenage girl survived and became the youngest recipient of the Nobel Peace Prize last week for her efforts to promote education and girls' rights.
Yousafzai said the attack left her heartbroken.
"Innocent children in their school have no place in horror such as this," she said.
Afghan Taliban slam Pakistan counterparts
This is the deadliest incident inside Pakistan since October 2007, when 139 Pakistanis died and more than 250 others were wounded in an attack near a procession for exiled former Pakistani Prime Minister Benazir Bhutto, according to the University of Maryland's Global Terrorism Database.
Even the Taliban in Afghanistan, who are closely affiliated with their Pakistani counterparts, criticized the killing of women and children as against Islamic teaching.
The spokesman for the Afghan terror group expressed condolences to the victims of Tuesday's attack.
CNN's Sophia Saifi reported from Islamabad, along with journalists Saleem Mehsud, Zahir Shah and Adeel Raja, and CNN's Faith Karimi and Greg Botelho wrote from Atlanta. CNN's Khushbu Shah contributed to this report.