Militants from the Pakistani Taliban have attacked a school in Peshawar, killing 141 people, 132 of them children, the military say.
Pakistani officials say the attack is now over, with all of the attackers killed. A total of seven militants took part, according to the army.
Scores of survivors are being treated in hospitals as frantic parents search for news of their children.
The attack is the deadliest ever by the Taliban in Pakistan.
There has been chaos outside hospital units to which casualties were taken, the BBC’s Shaimaa Khalil reports from Peshawar.
Bodies have been carried out of hospitals in coffins, escorted by crowds of mourners, some of them visibly distraught.
A Taliban spokesman told BBC Urdu that the school, which is run by the army, had been targeted in response to army operations.
Hundreds of Taliban fighters are thought to have died in a recent military offensive in North Waziristan and the nearby Khyber area.
US President Barack Obama condemned the “horrific attack (…) in the strongest possible terms”.
Analysis: Aamer Ahmed Khan, BBC News
This brutal attack may well be a watershed for a country long accused by the world of treating terrorists as strategic assets.
Pakistan’s policy-makers struggling to come to grips with various shades of militants have often cited a “lack of consensus” and “large pockets of sympathy” for religious militants as a major stumbling-block.
That is probably why, when army chief Gen Raheel Sharif launched what he called an indiscriminate operation earlier in the year against militant groups in Pakistan’s lawless tribal belt, the political response was lukewarm at best.
We will get them, was his message, be they Pakistani Taliban, Punjabi Taliban, al-Qaeda and affiliates, or most importantly, the dreaded Haqqani network. But the country’s political leadership chose to remain largely silent. This is very likely to change now.
Military spokesman Asim Bajwa told reporters in Peshawar that 132 children and nine members of staff had been killed.
All seven of the attackers wore suicide bomb vests, he said. Scores of people were also injured.
It appears the militants scaled walls to get into the school and set off a bomb at the start of the assault.
Children who escaped say the militants then went from one classroom to another, shooting indiscriminately.
One boy told reporters he had been with a group of 10 friends who tried to run away and hide. He was the only one to survive.
Others described seeing pupils lying dead in the corridors. One local woman said her friend’s daughter had escaped because her clothing was covered in blood from those around her and she had lain pretending to be dead.
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 peopleat 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
Irshadah Bibi, a woman who lost her 12-year-old son, was seen beating her face in grief, throwing herself against an ambulance.
“O God, why did you snatch away my son?” AFP news agency quoted her as saying.
The school is near a military complex in Peshawar. The city, close to the Afghan border, has seen some of the worst of the violence during the Taliban insurgency in recent years.
Many of the students were the children of military personnel. Most of them would have been aged 16 or under.
Hundreds of parents are outside the school waiting for news of their children, according to Wafis Jan from the Red Crescent
Malala Yousafzai, a Pakistani Nobel laureate who was shot by the Taliban for campaigning for the right to an education, condemned the attack.
“I, along with millions of others around the world, mourn these children, my brothers and sisters, but we will never be defeated,” she said.
Prime Minister Nawaz Sharif, who has arrived in Peshawar, described the attack as a “national tragedy”. Pakistani opposition leader and former cricket captain Imran Khan condemned it as “utter barbarism”.
A Taliban spokesman was quoted by Reuters as saying the school had been attacked because the “government is targeting our families and females”.