Ban said the "hearts of the world go out" to the parents and families of those killed in the brazen attack.
"No cause can justify such brutality; no grievance can excuse such horror. It is an act of horror and rank cowardice to attack defenceless children while they learn," he said.
The UN chief said schools must be safe and secure learning spaces and getting an education is every child's right.
In the worst attack in Pakistan in years, Taliban militants stormed Army Public School on Warsak Road and went classroom-to-classroom shooting indiscriminately.
More From This Section
Nearly 140 people, mostly students in the first through 10th grades, were killed in the attack, which came as a retaliation to Pakistan military's campaign against the militants in the northern region of the country.
UNICEF Executive Director Anthony Lake said the "horrific, callous" killing of children in Peshawar "must do more than shock the conscience of the world."
UN High Commissioner for Human Rights Zeid Ra'ad Al Hussein said Taliban "have sunk to an all-time depth with this attack," and called the attack "utterly despicable and incomprehensibly vicious."
"Everyone must now unite to combat this type of savage extremism. No government or intelligence agencies, no religious figures, no wealthy sponsors, no members of the general public can possibly justify continuing support for the Taliban, ISIL, Boko Haram, Al Qaida or any of these takfiri groups which appear to be competing to attain the highest level of human barbarity.