Hours after the attack, the Pakistani military was still exchanging gunfire with the militants inside the Army Public School and Degree College, in the violence-plagued city of Peshawar, about 120 kilometers (75 miles) from the country’s capital, Islamabad.
The army says most of the school’s 500 students have been evacuated. It is not clear how many are being held hostage.
The attack is seen as one of the worst yet in Pakistan
The hardline Islamist Taliban movement immediately claimed responsibility.
The Pakistani military said it had pushed the attackers to four blocks of the school, and killed all six.
The death toll has steadily risen, and officials fear it will climb higher. The number of injured was upwards of 100.
Most of those who died were between the ages of 12 and 16, said Pervez Khattak, chief minister of the Khyber Pakhtunkhwa province, where Peshawar is located.
The attack started at 10:00 local time (05:00 GMT). Mudassir Awan, a worker at the school, said he saw six people scaling the walls of the school.
“We thought it must be the children playing some game,” he told Reuters news agency. “But then we saw a lot of firearms with them.
“As soon as the firing started, we ran to our classrooms,” he said. “They were entering every class and they were killing the children.”
A school worker and a student interviewed by the local Geo TV station said the attackers had entered the Army Public School’s auditorium, where a military team was conducting first-aid training for students.
Locals said they also heard the screams of students and teachers. The dead are said to include teachers, as well as a paramilitary soldier.
Mohammed Khurrassani, the TTP spokesman, told CNN the attack was revenge for the killing of hundreds of innocent tribesmen during repeated army operations in provinces including South Waziristan, North Waziristan and the Khyber Agency — all restive regions along Pakistan’s border with Afghanistan.
For the past few months, the Pakistan military has been conducting a ground offensive aimed at clearing out militants in these areas. The campaign has displaced tens of thousands of people.
Northwestern Pakistan is home to loosely governed tribal areas. It’s also a base for foreign fighters and a refuge for members of the Taliban and other militant groups.