The Pakistan Taliban -- who have long conducted an insurgency against the Pakistani government as they seek to overthrow the authorities and bring in Sharia law -- were quick to claim the terror attack.
Photos: Taliban attack Pakistani school
Hundreds of students killed in attack
And they said it was revenge for the killing of hundreds of innocent tribesmen and their children during a recent offensive by the Pakistani military.
Since then, Pakistan's military has been conducting a ground offensive aimed at clearing out TTP and other militants in the loosely governed tribal areas of northwestern Pakistan. The campaign has displaced tens of thousands of people.
The Pakistan Taliban are also against Western-style education for children and the employment of women. Most famously, their militants shot schoolgirl education activist Malala Yousafzai in the head in 2012 as she traveled on a school bus. She survived to receive a Nobel Peace Prize last week.
The school attacked Tuesday, which educates both boys and girls in separate classes, is the main school for the children of army personnel in Peshawar and employs both male and female teachers-- making it a desirable target for the terrorists.
The Pakistan Taliban want to stop the authorities from interfering in the tribal areas but also have an extremist ideological agenda, said Sajjan Gohel, international security director for the Asia Pacific Foundation think tank.
The outlawed Islamist group is closely affiliated with the Taliban in Afghanistan and its members swear allegiance to the Afghan group's leader, Mullah Omar. It also has close ideological ties with al Qaeda.
"This is a terrorist outfit, it's not just a group that is seeking control of the tribal area," Gohel said.
And like their bedfellows, the Pakistan Taliban are vehemently opposed to the U.S. military presence in the region.
In addition to vowing to force U.S. troops out of Afghanistan, they claimed responsibility for the failed bombing in 2010 in New York's Times Square and vowed revenge operations against the United States for the killing of Osama bin Laden.
In 2012, a TTP leader endorsed "external" -- meaning overseas -- operations by the group against American and British targets. And its late leader, Hakimullah Mehsud, killed last year in a U.S. drone strike, once vowed to send suicide bombers to the United States.
Outrage 'off the charts'
So will the Pakistan Taliban get what they want from the massacre in Peshawar?
CNN national security analyst Peter Bergen believes it could backfire spectacularly on them.
The group may have gained a lot of publicity, he said, but this attack on schoolchildren is seen as beyond the pale, and the ripples will be felt through Pakistani politics.
"If the intent was to get the Pakistani military or the Pakistani government to back down, that is just not going to happen," he said. "I think the level of outrage in Pakistan right now is off the charts."
While many Pakistanis have in the past either supported the Pakistan Taliban or backed peace negotiations with them, that attitude is now likely to harden, said Bergen.
Previous attempts to forge a peace with the group in 2004, 2005 and 2008 fell apart, he said, and the chance of future talks seems slim. "The history of doing deals with religious zealots is not good," he said.
Splits and defections
The restive provinces of South Waziristan, North Waziristan and Khyber Pakhtunkhwa, along the mountainous border with Afghanistan, have long been a stronghold for the Pakistan Taliban and other militant groups, including the Islamist Haqqani movement.
And as the Pakistani military tries to clamp down on the TTP, it hits back with attacks.
Last year, 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 Pakistan Taliban claimed responsibility for the church attack, blaming the U.S. program of drone strikes in tribal areas of the country.
"Their primary target is the Pakistani state and its military," Raza Rumi of the Jinnah Institute, a Pakistani think tank, said of the TTP after the Karachi attacks in June.
"It resents the fact that (Pakistan) has an alliance with the West, and it wants Sharia to be imposed in Pakistan."
In recent months, the group has become increasingly fragmented -- meaning the formation of more militant factions -- and has suffered defections to ISIS.
At the same time, the Pakistani army has stepped up its military campaign in North Waziristan and Khyber Pakhtunkhwa.
'They are interested in killing'
Ayesha Siddiqua, a Pakistani analyst and author of "Military Inc.," told CNN that Pakistan needs to rethink its approach to militant groups and whether any form of militancy is tolerated in the country.
"Unless that happens, this bloodshed will continue," she said.
However, even the latest attack is unlikely to prompt a major shift in policy, she argued, with some political elements within Pakistan continuing to be sympathetic to the TTP regardless.
With this attack, Siddiqua said, the Pakistan Taliban are trying to "achieve as much bloodshed and as much horror and terror" as they can, arguing it's revenge for their own families being killed.
"Very clearly, their objective is maximum damage, as many people as they can kill. They are not interested in hostages, they are interested in killing," she said.
"Since they cannot access hard targets so easily, they are going after softer targets."
Analyst Gohel said this shift in approach by the Pakistan Taliban was extremely disturbing.
"To target a school is another dynamic altogether, and especially one that is supported by the military," he said.
"It's a very clear statement of intent. They have been battling the military for a long time, now they are trying to visualize the terrorism effectively, as we are seeing with those graphic images that are being beamed around the world."
Obstacles to tackling the Pakistan Taliban lie in the country's complex politics, its troubled relationship with Afghanistan, and differences over foreign policy between Pakistan's government and its military, said Gohel.
The Pakistan Taliban and their counterparts in Afghanistan move back and forth across the porous border, sharing resources, cooperating and jointly plotting attacks, said Gohel.
"There's no way of trying to challenge that unless you dismantle the infrastructure. And this is where the problem lies in Pakistan," he said. "The military will not dismantle the infrastructure for the Afghan Taliban, which allows the Pakistan Taliban to continue to exist."
And, he warned, the withdrawal of Western combat troops from Afghanistan by the end of this year is likely only to heighten the problem, as the Taliban step in to fill the resulting security vacuum.
"The Taliban have been biding their opportunity, waiting to carry out plots and activities, to try and regain a foothold especially in southern Afghanistan," he said.
"They will be cooperating with the Pakistan Taliban. There is this paradox that is creating this problem. You have the Pakistani military sponsoring and supporting the Afghan Taliban, (while) fighting the Pakistan Taliban, but both Talibans cooperate because they have that Pashtun ethnic factor that unites them."
Recent Pakistani offensives had been believed to have weakened the group, but it is clearly still all too capable of a shocking attack.
CNN's Jim Sciutto and Sophia Saifi contributed to this report.