ISLAMABAD, Pakistan (CNN) – A Taliban group killed at least 145 people, including 132 children, in an attack on a military school in northwest Pakistan on Tuesday morning.Pakistan is mourning as the nation prepares for mass funerals for 141 people, most of them children, killed in a Taliban attack on a military-run school in the country’s

The Pakistani military said by late afternoon that it had killed all seven militants involved in carrying out the siege at the Army Public School and Degree College. It was one of the deadliest attacks seen in the violence-plagued city of Peshawar, located about 75 miles from the country’s capital of Islamabad.

Explosions were heard outside the school about mid-morning, and were meant as a diversionary tactic, officials said.

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.

Scaling the walls

The Pakistan Taliban – Tehreek e Taliban Pakistan (TTP) – said  suicide bombers scaled the walls of the school with orders to kill older students about 10 a.m.

The Taliban reported that “300 to 400 people are under the custody of the suicide bombers” shortly after the attack.

By Tuesday evening, the toll was determined to be the 132 children, 10 school staff members and three soldiers. More than 100 more were injured, Pakistani officials said.

Revenge attack

Mohammed Khurrassani, the TTP spokesman,said 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.

Violent past

The military offensive in the region has spurred deadly retaliations.

In September, choir members and children attending Sunday school were among 81 people killed in a suicide bombing at the Protestant All Saints Church of Pakistan. A splinter group of the Pakistani Taliban claimed responsibility for the church attack, blaming the U.S. program of drone strikes in tribal areas of the country.

Prime Minister Nawaz Sharif rushed to Peshawar, declared three days of mourning, and said he would personally oversee the operation to flush out the militants.

Peace falters

As recently as last spring, the Taliban and the Pakistani government were involved in peace talks. The government released 19 Taliban noncombatants in a goodwill gesture.

But talks broke down under a wave of attacks by the Taliban and mounting political pressure to bring the violence under control.