Editor's note: Peter Bergen is CNN's national security analyst, a vice president at New America and professor of practice at Arizona State University. He is the author of "Manhunt: The Ten-Year Search for bin Laden -- From 9/11 to Abbottabad."
(CNN) -- The slaughter of more than 130 children at a school by the Pakistani Taliban on Tuesday may prove as pivotal to Pakistan's national security policy as the 9/11 attacks were for the United States.
For decades since its founding in 1947, Pakistan has conceived of its neighbor India as its main enemy. Indeed, the two countries have fought three major wars with each other as well as many smaller skirmishes.
With Tuesday's attack, it is abundantly clear to all Pakistanis that their main enemy is the internal enemy -- the Pakistani Taliban.
This realization has been a long time coming, but it has finally come because the Taliban have killed thousands of Pakistani soldiers, police and civilians over the past decade. And with Tuesday's attack the level of Pakistani outrage against the Taliban is now at unprecedented levels.
There is a widespread narrative in the United States that the Pakistani government has not done enough to counter the Taliban. That narrative is out of date. In fact there has been a sea change in how, in particular, the Pakistani military regards the Taliban, whom it once supported.
In August 2012, Ashfaq Parvez Kayani, then the army chief general, gave a speech in Pakistan that didn't get much attention in the West, but it was a clear statement that the most important player in Pakistan's national security was reformulating Pakistani strategy from its overwhelmingly India-focus to the domestic threat posed by the Pakistani Taliban.
Kayani said, "We realize that the most difficult task for any army is to fight against its own people. ... The fight against extremism and terrorism is our own war and we are right in fighting it."
This policy of taking the fight to the Pakistani Taliban has been continued by the new army chief general, Raheel Sharif, who visited the United States last month, a trip that was notable for the warm reception he received in Washington and also at U.S. Central Command in Tampa, Florida, which manages the war in Afghanistan. This visit was all in stark contrast from three years ago when Pakistani-American relations were at their nadir following the raid in Abbottabad, Pakistan, in which Osama bin Laden was killed.
The principal reason for the warming U.S.-Pakistan relationship has been the large-scale operation that the Pakistani military launched beginning in June into the remote tribal region of North Waziristan along the Afghan-Pakistan border.
North Waziristan is the headquarters of the Pakistani Taliban, the notorious Taliban-affiliated Haqqani Network and remnants of al Qaeda. Launching such an operation has long been a key demand of the United States to the Pakistani military and government.
According to the Pakistani military, during the past six months, it has killed more than 1,000 militants. Among them was the death this month of Adnan Shukrijumah, a key leader of al Qaeda who grew up in New York and Florida.
From multiple sources in the Pakistani military and the U.S. government I have heard that it was the Pakistani military, not the civilian government, that was pushing hard to conduct the North Waziristan operation.
Earlier in the year, the civilian government, led by Prime Minister Nawaz Sharif, clung to the hope -- in reality, a delusion -- that some kind of a peace deal could be struck with the Pakistani Taliban.
As Tuesday's despicable attack makes clear, the Pakistani Taliban are not a bunch of Henry Kissingers-in-waiting eager to make a deal, but rather are led by fanatical religious zealots willing to send half a dozen suicide attackers to kill scores of children. The history of negotiations with fanatical religious zealots is not an encouraging one.
Indeed, anyone with the most passing knowledge of previous "peace" deals with the Pakistan Taliban would have understood the futility of trying to make a deal with them. The Pakistani government concluded peace deals with the Taliban in 2004, 2005 and 2008. All of the deals collapsed.
Today the Pakistani military understands that the Frankenstein that it helped to create must now be killed. It will have the support of the vast majority of Pakistanis to do so.