The uncle and cousin of injured student Mohammad Baqair, center, comfort him as he mourns the death of his mother who was a teacher at the school which was attacked by Taliban, in Peshawar, Pakistan, Tuesday, Dec. 16, 2014. Taliban gunmen stormed a military-run school in the northwestern Pakistani city of Peshawar on Tuesday, killing more than 100, officials said, in the highest-profile militant attack to hit the troubled region in months. (AP Photo/Mohammad Sajjad)

Pakistanis are still grappling with the tragedy of the Taliban attack on a school in Peshawar that left at least 141 people, most of them children, dead and scores injured. There has been an outpouring of grief internationally, and the Pakistani public is visibly outraged. But the question being widely asked is whether Pakistan's military and political leaders can transform grief and outrage into a clear policy that would rid the country of its reputation as both a victim of and magnet for terrorists.

"The question being widely asked is whether Pakistan's military and political leaders can transform grief and outrage into a clear policy that would rid the country of its reputation as both a victim of and magnet for terrorists."

The latest attack is the Taliban's response to the Pakistan army's military operation against the terrorist safe haven in North Waziristan, part of the tribal region along the border with Afghanistan. Jihadis from all over the world had congregated in the tribal areas to fight as Mujahedeen against the Soviets during the 1980s. After the Soviets left, Pakistan used the militants for its own objectives of expanding Pakistani influence in Afghanistan, leading to the rise of the Taliban.

After 9/11, Pakistan cooperated with the United States in dislodging the Taliban from power in Kabul, only to give them sanctuary on its territory. Gen. Pervez Musharraf, who ruled as military dictator from 1999 to 2008, crafted a graduated policy that differentiated between various terrorist groups. While many foreign (mainly Arab) terrorists with links to Al-Qaeda were handed over to the United States, local jihadis as well as the Afghan Taliban were left alone. Covert support for the Afghan Taliban was Pakistan's insurance policy to deal with the aftermath of a U.S. military withdrawal from Afghanistan.

While the Afghan Taliban may have felt indebted to Pakistan's intelligence service, the Pakistani Taliban had no such feelings. Inspired initially by Al-Qaeda and more recently by Daesh (the Islamic State), various factions of Pakistani Taliban have waged war against the people and state of Pakistan. While they have been consistent in their savagery, Pakistani authorities have not been consistent in their response to their threat.

In 2008, Pakistan's military cleared out the Taliban from the Swat valley, home of Nobel laureate Malala Yousafzai. More recently, new Army Chief General Raheel Sharif ordered his troops into North Waziristan. Although the Pakistanis have routed and displaced several jihadi groups based in the tribal areas, the terrorists retain the ability to regroup and resume operations in other parts of the country.

The savage attack in Peshawar demonstrates the futility of attacking one group of jihadis while leaving others in place. But there is still no sign that Pakistan will give up its policy of embracing some jihadis for regional influence against India and Afghanistan while fighting others.

Pakistan's military and intelligence service still hold on to the notion that the country faces an existential threat from its much larger neighbor, India, out of which Pakistan was carved out in 1947. The division of Pakistan and the birth of Bangladesh, with support from India, in 1971 also still loom large in the Pakistani elite's imagination.

Although nuclear deterrence should have bolstered Pakistan's national self-confidence, the nation feels more insecure now than it did in its early years. Pakistanis readily believe conspiracy theories about the United States and Israel, in addition to India, wanting to take away its nuclear weapons.

Jihadi militancy and terrorism have traditionally been ways of enabling Pakistan to stand up to a bigger and increasingly powerful India through asymmetrical warfare. During the war against the Soviets, Pakistan used American money, weapons and training not only to equip fighters for fighting the Soviets in Afghanistan, but also to raise brigades of irregular fighters for Indian-controlled Kashmir.

The policy of allowing militant groups to operate on Pakistani soil has proved disastrous. The jihadi militants do not accept the neat divisions between global, regional and local conflicts. Once they are convinced of the righteousness of their cause, they are willing to fight and blow themselves up anywhere. Rising militancy coupled with a significant decline in the capacity of the state has enabled Pakistan-based jihadi groups to wreak havoc not only in India and Afghanistan but also in Pakistan and its friendly neighbors, Iran and China.

"The savage attack in Peshawar demonstrates the futility of attacking one group of jihadis while leaving others in place."

Extremist Islamists and jihadists have benefited from Pakistan's self-definition as an Islamic state. Given the centrality of Islam in Pakistan's national identity, secular leaders find it difficult to create national consensus against groups that describe themselves as soldiers of Islam. But a consensus against militancy is what Pakistan badly needs. On several occasions during the last few years, Taliban atrocities have resulted in backlash that has subsequently abated as a result of propaganda against India or the West.

In October 2011, Hillary Clinton had told Pakistani officials that "you can't keep snakes in your backyard and expect them only to bite your neighbors." Her dire prediction that "eventually those snakes are going to turn on whoever has them in the backyard" has been coming true with considerable regularity. The senseless massacre of schoolchildren in Peshawar represents a new level of atrociousness in the Taliban's behavior. Will it finally convince Pakistanis to hunt down the snakes in their backyard?

(Husain Haqqani, director for South and Central Asia at the Hudson Institute, was Pakistan's ambassador to the United States from 2008-11. He is most recently author of "Magnificent Delusions: Pakistan, the United States and an Epic History of Misunderstanding").

PHOTO GALLERY Taliban Gunmen Hold Hundreds Hostage At Pakistan School