LONDON — First the Pakistani Taliban bombed or burned over 1,000 schools. Then they shot Malala Yousafzai, the teenage advocate for girls’ rights.

But on Tuesday, the Taliban took their war on education to a ruthless new low with an assault on a crowded school in Peshawar that killed 145 people — 132 of them uniformed schoolchildren — in the deadliest single attack in the group’s history.

During an eight-hour rampage at the Army Public School and Degree College, a team of nine Taliban gunmen stormed through the corridors and assembly hall, firing at random and throwing grenades. Some of the 1,100 students at the school were lined up and slaughtered with shots to the head. Others were gunned down as they cowered under their desks, or forced to watch as their teachers were riddled with bullets.

Their parents crowded around the school gates, praying their children would survive while listening to the explosions and gunfire as Pakistani commandos stormed the building.