Pakistani leader Nawaz Sharif has vowed to rid his country of terrorism after a Taliban attack at a school in Peshawar killed 141 people, mostly children.
He spoke after emergency talks with all main political parties to discuss the attack, which sparked national outrage.
The funerals of the victims are continuing throughout the day across the country, as well as prayer vigils.
Gunmen went from class to class shooting the students in the Pakistani Taliban’s deadliest attack to date.
New images of the school published by a BBC team that gained access to the site on Wednesday showed the scale and brutality of the attack, with pools of blood on the ground and walls covered in pockmarks from hundreds of bullets.
The Pakistani Taliban (TTP) said they had carried out the attack against the Army Public School to avenge army-led operations against them in the Khyber and North Waziristan areas.
Pakistan’s army chief General Raheel Sharif is on a surprise trip to Afghanistan to discuss security co-ordination aimed at tackling the Taliban insurgency.
Prime Minister Nawaz Sharif said Pakistan stood united to ensure the deaths of the children were not wasted, after meeting party leaders in Peshawar on Wednesday.
In any action against the militants, he said, there would be no distinction between “good and bad” Taliban.
“We…have resolved to continue the war against terrorism till the last terrorist is eliminated,” he added.
He also announced an end to the moratorium on the death penalty for terrorism cases, which correspondents say is a move aimed at countering a view held by many Pakistanis that many terror suspects end up evading justice.
At the scene: Mishal Husain, BBC News
It was a very eerie atmosphere. These were premises that should have been alive to the sound of hundreds of children who studied here and began school as normal on Tuesday. But it was now desolate.
The army has been working through the night to clear the premises of explosives.
There were blood stains running right down the steps and towards the auditorium itself.
There was a child’s shoe on one of the steps. The auditorium, where children were taking exams, was one of the places within the school grounds that the militants first targeted.
The chairs that the children were sitting on had been upturned, the place has been turned upside down and I could see the blood stains on the floor right around me.
Pakistani Taliban (TTP) leader Mullah Fazlullah is believed by the Pakistani authorities to be hiding in Afghanistan, and media reports in Pakistan suggest the school attack may have been co-ordinated from Afghanistan.
But the TTP said the attack had been masterminded by its military chief in the Peshawar region, who it said had been in touch with the gunmen throughout the assault.
A TTP spokesman told the BBC they had deliberately killed older pupils and not targeted “small children”.
BBC correspondents say the Taliban statement is being seen as damage limitation after the attack was universally condemned in Pakistan for its brutality.
World leaders voiced disgust at the attack. Even the Afghan Taliban have criticised the attack, calling it “un-Islamic”.
The TTP also repeated its earlier claim that only six attackers were sent, contradicting official accounts that seven gunmen were killed. The militants say the attack was revenge for the army’s campaign against them, and that they chose the school as a target because their families had also suffered heavy losses.
The Taliban attackers wearing bomb vests cut through a wire fence to gain entry to the school, before launching an attack on an auditorium where children were taking an exam.
Gunmen then went from room to room at the military-run school, shooting pupils and teachers where they found them in a siege that lasted eight hours, survivors said.
“This is not a human act,” military spokesman Major General Asim Bajwa said during a tour of the school on Wednesday, the Associated Press reports. “This is a national tragedy.”
A total of 125 people were wounded at Peshawar’s Army Public School, which teaches boys and girls from both military and civilian backgrounds. All seven attackers were killed, while hundreds of people were evacuated.
Mohammad Hilal, a student in the 10th grade, was shot three times in his arm and legs when the gunmen stormed the school auditorium.
“I think I passed out for a while. I thought I was dreaming. I wanted to move but felt paralysed. Then I came to and realised that actually two other boys had fallen on me. Both of them were dead,” he told the BBC.
Prayer vigils are being held nationwide, with Pakistani embassies across the world lowering their flags to half-mast and opening books of condolences.
India’s parliament observed a minute’s silence in honour of the victims.
Hundreds of Taliban fighters are thought to have died in the recent Pakistan army offensive in the Khyber area and North Waziristan, regions close to the Afghan border
Deadly attacks in Pakistan
16 December 2014: Taliban attack on school in Peshawar leaves at least 141 people dead, 132 of them children
22 September 2013: Militants linked to the Taliban kill at least 80 people at a church in Peshawar, in one of the worst attacks on Christians
10 January 2013: Militant bombers target the Hazara Shia Muslim minority in the city of Quetta, killing 120 at a snooker hall and on a street
28 May 2010: Gunmen attack two mosques of the minority Ahmadi Islamic sect in Lahore, killing more than 80 people
18 October 2007: Twin bomb attack at a rally for Benazir Bhutto in Karachi leaves at least 130 dead. Unclear if Taliban behind attack[BBC]