Pakistani soldiers remain on patrol on the streets of Peshawar overnight, and the army could now push for a more drastic response in the aftermath of Tuesday's attack. You can get all the latest updates on this and other stories on the BBC News website. Thanks for staying with us.
As it happened: Pakistan school attack
- Officials say more than 140 people, mostly children, have been killed in a Taliban attack on an army-run school in north-west Pakistan
- Pakistan's security forces say their operation has now ended, with all seven attackers killed
- Some pupils, who escaped, earlier said the gunmen went from classroom to classroom, shooting children indiscriminately
- The Taliban say the assault is in response to army operations in North Waziristan and the Khyber area. All times GMT
This brings to an end our live coverage of the storming of the army-run school in Peshawar by Taliban gunmen. The attack left at least 141 people dead - 132 of them children - and many others wounded.
In the aftermath of the attack it may now be dawning on Pakistan's generals and politicians that Sunni extremists present an existential threat to their own country, a commentary in the Financial Times says. It describes events on Tuesday as "one of the darkest days in the country's history".
BBC World Affairs correspondent
The Afghan Taliban have criticised Tuesday's attack as un-Islamic. The group's spokesman Zabihullah Mujahid said that they were sending their condolences to the families of the children killed in the attack and shared their sadness. The Afghan Taliban are stepping up their attacks in Afghanistan and share roots with the Pakistani Taliban. They usually share the same ideology too.
The deputy leader of the PTI party - which leads the coalition government in Khyber Pakhtunkhwa province - tells the BBC that no amount of security could prevent random acts of violence from occurring. Shah Mehmood Qureshi said that provincial capital Peshawar is always on a state of high alert, adding that the people of Pakistan needed to be united in facing their enemies and that a "collective strategy" was necessary to deal with the "menace of terrorism".
PTI chief Imran Khan has announced that he will call off his 18 December nationwide strike following the massacre in the school, the APP news agency says.
Pakistani mourners carry the coffin of a teacher during his funeral following the attack by Taliban gunmen on a school in Peshawar.
Schools in Pakistan have long been in the crosshairs, the Guardian's Jason Burke writes. More than 1,000 have been destroyed by Islamist militants from one faction or another in the province of Khyber-Pakhtunkhwa in the past five years. The institutions are seen to represent un-Islamic government authority.
says previous terrorist attacks in Pakistan have not produced consistent responses from the authorities. The 2008 bombing of the Marriott Hotel in Islamabad killed 53 people, prompting the the government and the military to launch a major offensive, but they remained divided over who to blame: extremists citing Islam, or America for going after them. In 2012, Pakistani Taliban gunmen seriously injured the 14-year-old campaigner for girls' rights Malala Yousafzai, accused of "promoting secularism". Again, there was a brief upsurge of anger... Then, this June government peace talks with the Taliban collapsed after a murderous assault on Karachi's international airport,.
Pakistani army spokesman Maj Gen Asim Bajwa - who provided detailed information about the attack - on Tuesday was at the centre of attention of the Pakistani and world media.
"We support the measures undertaken by the government of Pakistan aimed at the extermination of the hotbeds of terrorism," a statement by the Russian foreign ministry quoted by the APP says. "We expect Pakistan to continue with its uncompromising struggle to eliminate the extremist infrastructure. Russia is ready to proceed with assisting the Pakistani government in its efforts to fight terror."
emails: I am studying in my first year. Should I be killed too? This act completely showed that terrorists are not against the children of Pakistan but against humanity. Isn't this our right to get an education?
Indian PM Narindra Modi has telephoned his Pakistani counterpart Nawaz Sharif to express his deep grief and sorrow over the killing of innocent people in Peshawar, the Pakistani APP news agency reports.
BBC News, Peshawar
On air at 1800GMT the BBC's World Have Your Say will be speaking to people across Pakistan, to hear reaction to the attack. Listen Live here (http://www.bbc.co.uk/programmes/p02dwbkn) and get in touch; you can tweet us @BBC_WHYS.
The Pakistani APP news agency has produced a chronology of the attack:
- Initially a suicide bomber managed to enter the auditorium of the school where a seminar was under way and blew himself up amid a group of students
- Other armed militants wearing military uniforms then forced their way into the school, some firing indiscriminately and others taking the principal, about 20 teachers and a group of 34 students hostage for eight hours
- The army operation against the militants began at 10:00 local time (05:00 GMT) and ended at 18:00 (13:00 GMT). The teachers and students held hostage were freed
- Four of the attackers blew themselves up while two were shot dead by the security forces at midday
- The last two gunmen, who were holding the teachers and pupils, were shot dead after a fierce gun battle (other reports suggested seven gunmen were involved in the attack)
Outpourings of grief are taking place all over Peshawar well into the night as the city tries to come to terms with one of Pakistan's deadliest terror attacks.
Schools across Peshawar were evacuated after the attack as a precaution. Here, a plainclothes security officer is seen taking pupils to safety.
emails: I cannot find words to describe what we have lived today here. My 15-year-old son was wounded by a bullet. He was hit on the left side of the head, above the ear. He is in hospital now and doctors say the wound is not serious. The bullet just touched his head. I was in the office when I heard that something had happened at the school. I was hoping to find my son but I could not go in, security were not allowing anyone to do so. Thankfully, I got a call from the hospital to say that my son was there.
M Ilyas Khan
BBC News, Islamabad
Sajid Khalid - who lives in the British city of Birmingham - attended the school in Peshawar as a child and his relatives were there during the attack. "I was shocked because most of our family, kids, they live locally - just two miles away, and most of the students they study in the school," he told the BBC. "So totally I was horrified. Straight away I just rang my brother. He was crying. I thought - is everything OK? He says no, my kids are OK but I'm in hospital with the other kids - like from seven to 14-15 year olds and dead bodies everywhere."
More from Shahrukh Khan: "The man with big boots kept on looking for students and pumping bullets into their bodies. I lay as still as I could and closed my eyes, waiting to get shot again," he said. "My body was shivering. I saw death so close and I will never forget the black boots approaching me - I felt as though it was death that was approaching me."
Teenager Shahrukh Khan describes how he managed to survive the attack. "I saw a pair of big black boots coming towards me, this guy was probably hunting for students hiding beneath the benches," he told the AFP news agency. He says he decided to play dead, despite being shot in both legs, by stuffing his tie into his mouth to stifle his screams.
reports that the attackers entered the school with supplies, preparing for a long haul.
Women mourn their relative Mohammed Ali Khan - a 15-year-old student who was killed during the attack - at his house in Peshawar.
More from British PM David Cameron (see 16:12 entry). He says: "The scale of what has happened in Pakistan simply defies belief. It is a dark, dark day for humanity when something on this scale happens with no justification. There is not a belief system in the world that can justify such an act. I think what this shows is the worldwide threat that is posed by this poisonous ideology of extremist Islamist terrorism."
Pakistani PM Nawaz Sharif has announced three days of national mourning, the Pakistani newspaper The Express Tribune reports. The paper's website has changed the usual red colour of "The Express" words of its title into black, in what appears to be a sign of mourning. (BBC Monitoring).
Funerals have been taken place across Peshawar following the school attack.
More from army spokesman Maj Gen Asim Bajwa: "[The militants] were contained and pushed back [before they were] confined into one block, where they were killed finally in the evening. "There were about 1,100 students and staff who were registered in this school. Out of them, 960 have been rescued by our security forces, especially the special services group."
"My son was in uniform in the morning. He is in a casket now,'' distraught father Tahir Ali is quoted by the AP news agency as saying. Speaking while collecting the body of 14-year-old son Abdullah from hospital, he said: "My son was my dream. My dream has been killed."
The BBC's Shaimaa Khalil in Peshawar has just spoken to Said - one of the survivors of the attack. Said, who was shot in the arm, said he survived by hiding under the chair.
More comment from the Taliban in their efforts to justify the attack: "What about our kids and children?" alleged commander Jihad Yar Wazir is quoted as asking the Daily Beast. "The parents of the army school are army soldiers and they are behind the massive killing of our kids and indiscriminate bombing in North and South Waziristan. To hurt them at their safe haven and homes - such an attack is perfect revenge."
The attackers "didn't take any hostages initially and started firing in the hall" as soon as they entered the school premises, military spokesman Maj Gen Asim Bajwa says.
In Islamabad, activists and journalists lit candles in memory of the Peshawar victims, demanding an end to violent attacks.
British Prime Minister David Cameron says the school attack is a "a dark, dark day for humanity".
The militants made no demands; they started killing children as soon as they entered the school, the Pakistani army is quoted as saying by Reuters.
Pakistan's army spokesman Asim Bajwa says 132 children and nine staff members were killed in the attack.
BBC News, Peshawar
What we are yet to know is whether all the children have been evacuated or if some are still in the school. That is really what many of the parents here [at the school] are worried about - they want to know if these other children are OK.
UN High Commissioner for Human Rights Zeid Ra'ad al-Hussein - the first Muslim and the first Arab to hold the office - accuses the Taliban of "sinking to an all-time depth" in carrying out the attack. He says the group's ideology "bears no resemblance to any religion or any cultural norm".
The Pakistani Taliban has grown more extreme and violent as its circumstances have grown more dire, the Guardian's Jason Burke reports. He says that the movement has recently been divided by bitter internal competition and that when militants organisations do this, they "often become more extreme as individual commanders and their followers seek to prove themselves the most effective, and the most audacious".
Although the army says the attack on the school is now over, soldiers are continuing to patrol the streets of Peshawar.
UN Secretary General Ban Ki-moon describes the attack as "an act of horror and rank cowardice to attack defenceless children while they learn". He adds that "no cause can justify such brutality and no grievance can excuse such horror".
Afghan President Ashraf Ghani condemns the attack as a "wild act". He says killing innocent children is an absolutely un-Islamic and inhuman act. The BBC's Mike Wooldridge says that both Afghanistan and Pakistan face continual attacks by their respective Taliban movements, and both have frequently accused each other of supporting militant extremism.
Pakistani journalist Ahmed Rashid tells the BBC the Taliban raid was "a revenge attack, as many children in the school are sons and daughters of army officers". Mr Rashid adds it was also "an attempt to unify the Taliban, who are currently divided"
Earlier in the day, Pakistani troops sealed off the area, taking up positions around the school in Peshawar.
"The carnage struck at the heart of Pakistan's military - one of the nation's most highly respected institutions - which is seen as the guardians of stability in a turbulent region and an important bridge between Pakistan and Western allies such as the United States," the Washington Post reports.
Shocked relatives have been waiting outside Peshawar's Lady Reading Hospital - desperate to hear about the fate of their loved ones.
"This is the world's loss," Mr Kerry says. "This act of terror angers and shakes all people of conscience, and we condemn it in the strongest terms possible."
Following on from President Obama, US Secretary of State John Kerry describes the attack as "absolutely gut wrenching... A house of learning turned into a house of unspeakable horror".
Pakistan's MQM party leader Altaf Hussain is the latest politician strongly to denounce the attack. "I call upon the authorities to take all necessary action to bring the perpetrators of the abhorrent attack to justice," he says.