Wounded children and teachers were rushed to a hospital in Peshawar after Taliban gunmen took hundreds of hostages at a school, killing at least 130 people.

An official said more than 100 of the dead were children. A hospital spokesman said the dead and wounded it had seen were aged between 10 and 20.

peshawar school attack
A man carries an injured girl after the attackA Majeed/AFP
peshawar school attack
An injured student is taken to a hospital wardFayaz Aziz/Reuters
peshawar school attack
A man comforts his injured son at Lady Reading Hospital in PeshawarReuters
peshawar school attack
Men help an injured student to a hospital following the attack on the schoolA Majeed/AFP

Troops surrounded the school building and troops started an operation to rescue children still trapped inside.

Hours into the siege, three explosions were heard inside the military-run high school.

Outside, as helicopters rumbled overhead, police struggled to hold back distraught parents who were trying to break past a security cordon and get into the school.

An unspecified number of children were still being held hostage in the school, a provincial official said, speaking some three hours after the siege began.

peshawar school attack
Relatives of an injured student comfort each other outside Lady Reading Hospital.Fayaz Aziz/Reuters
peshawar school attack
Parents hurry their children away from the scene of the attackA Majeed/AFP
peshawar school attack
Pakistani soldiers transport rescued school children from the schoolA Majeed/AFP
peshawar school attack
Rescue workers and family members carry the coffin of a student killed during an attack by Taliban gunmen on the Army Public School in Peshawar.Khuram Parvez/Reuters

It is not clear whether some or all of the children were killed by gunmen, suicide bombs or in the ensuing battle with Pakistani security forces.

The Pakistani Taliban, who are fighting to topple the government and set up a strict Islamic state, have vowed to step up attacks in response to a major army operation against the insurgents in the tribal areas.

peshawar school attack
A Pakistani soldier takes up position above a road near the school in PeshawarKhuram Parvez/Reuters
peshawar
A soldier escorts children away from the Army Public School in PeshawarKhuram Parvez/Reuters
peshawar school attack
A man carries a student who was injured during the attack in PeshawarKhuram Parvez/Reuters

An expert on the Taliban told the BBC that one of the reasons for attacking the school was to send a message to the supporters of Malala Yousafzai. The Pakistani schoolgirl activist advocates education for women and children, and was awarded the 2014 Nobel Peace Prize.

"I am heartbroken by this senseless and cold blooded act of terror in Peshawar that is unfolding before us," said Malala in a statement. "I, along with millions of others around the world, mourn these children, my brothers and sisters, but we will never be defeated."