Today’s horrific attack in Peshawar on a military school, in which scores of children were killed by the Pakistani Taliban, should put Pakistan’s security choices over the last few decades in a stark light. And while the immediate reaction from the Pakistani military will no doubt be swift and terrible, Pakistan needs to think long and hard about what kind of country it wants to be when the initial retaliation is over.

Will it be one that continues to treat extremist groups as assets to use against its regional rivals? Or will this stomach-churning attack finally be the last straw that convinces the “establishment,” as it’s called, that playing with the fire of Islamic radicalism cannot continue.

“We’ve made huge sacrifices in the war on terror,” says Erum Haider, a Pakistani graduate student at Georgetown. “Whatever strategic interests there are or were in the region, the children and parents of Pakistan didn’t ask for them.”

History, geography, and the leaders of both the United States and Pakistan have conspired to make Pakistan a frontline state in the war on terror. And Pakistan has a long history of using non-state actors to project power beyond its borders. Driven by a deep sense of insecurity regarding Afghanistan and India, Pakistan has pursued a security strategy that incorporates conventional elements of deterrence—the world’s sixth largest army and the fastest-growing nuclear arsenal—with the use of militant groups that allow it to harass its rivals while maintaining a thin fiction of deniability.

As Saed Shah wrote in The Economist back in 2011, Pakistan feels it has no choice but to support jihadist groups. Archrival India has money to throw around, and Iran and Russia are also exerting influence in the region. So Pakistan, as a senior Pakistani official told Shah, is forced to play the latest version of the Great Game, too. “Except we have no money. All we have are the crazies. So the crazies it is.”

The list of “crazies” supported by Pakistan is long: Lashkar-e-Taiba, which attacked Mumbai in 2008 with help from former members of Pakistan’s Inter-Services Intelligence spy agency; the Haqqani network, one of the most ruthless and effective groups operating in Afghanistan, which also was behind the 2011 bombing of the Indian embassy in Kabul with the connivance of the ISI; and of course the Afghan Taliban, set up in the mid-1990s under the mentorship of the former director general of the ISI, Hamid Gul, who to this day spews anti-Western conspiracies on mainstream Pakistani television shows.

And that’s just the biggest crazies. There are Kashmiri separatist groups, groups that demand the slaughter of Shiites, and—perhaps—al Qaeda and Osama bin Laden, if you believe Carlotta Gall’s reporting.

The Pakistani Taliban, which has claimed credit for today’s attack, is not considered part of that toxic stew by the generals. It is “the bad Taliban,” as it’s often called, implying those other mass murderers are the good ones. And the reason it’s “good,” in the minds of the spy chiefs and generals, is because it does Pakistan’s bidding and doesn’t attack the state.

That’s a dangerous opinion to hold.

“While Pakistan might think that the Haqqani network is useful for Afghanistan, and in return that they will not attack inside Pakistan, the reality is that the Haqqani network can still provide support to Pakistani Taliban that can attack inside Pakistan,” said Husain Haqqani, director for South and Central Asia at the Hudson Institute in Washington, D.C., former Pakistani ambassador to the United States, and author of Pakistan: Between Mosque and Military.

“Pakistan needs to get out of denial that there are any jihadi groups that can be trusted or considered allies of the state,” he said. “However useful they might be for external purposes, they will always be dangerous internally.”

Although it differs in its targets, the Pakistani Taliban, which calls itself Tehrik-i-Taliban Pakistan (TTP), arose from the same ideological swamp as the other groups. The harsh Islamization of Pakistan, which started under Zulfikar Bhutto in the mid-1970s—when he forged tighter bonds with Saudi Arabia, declared the minority Muslim sect Ahmadis as non-Muslims, and banned the sale of alcohol, all for the political support of the religious class—only accelerated under the military rule of Zia-ul-Haq.

After the Soviet Union invaded Afghanistan in 1979, Zia feared further Soviet aggression and worked with the United States and Saudi Arabia to bog down the Red Army, fostering the seven mujahideen groups—including what would become the Haqqani network—and encouraging the further Islamization of Pakistani society in the face of “atheistic and communist” aggression from Moscow.

Since the collapse of the Soviet Union following its retreat from Afghanistan, Pakistan has helped, or at least not hindered, the rise of groups like Lashkar-e-Taiba and the Afghan Taliban, all of which were considered useful.

But why did the generals feel the need to rely on these groups, even after the Soviets left Afghanistan?

“Pakistan now has a nuclear deterrent, so therefore it does not have an external security challenge of the type that Pakistanis have consistently been brought up to fear,” Haqqani said. “Nobody can send in an army and occupy Pakistan anymore. So this should have been a time for Pakistan to feel more secure … and start building inwards.”

But instead, he said, driven by six decades of insecurity, the Pakistani deep state decided it wanted to be as powerful as India, a country more than six times the size of Pakistan and immeasurably wealthier.

“This pursuit of parity is what necessitates asymmetrical warfare capability, because that’s the only thing that gives them an advantage,” he said. “But events like this should make the Pakistani deep state realize that asymmetric warfare is never a good capability to have at the level we have developed.”

“As Hillary Clinton said, ‘You can’t nurture snakes in your backyard.’”

In short, Pakistan can’t quit its crazies.

“[Today’s attack] is a result of a sustained policy gone wrong,” Haqqani concluded. “And it can only be changed by a new, sustained policy.”

So what should be done? So many decades of pushing an anti-Western agenda in the media has made much of the Pakistani public—and certainly large swaths of its middle class—open to religious and nationalist appeals. There are many in Pakistan, for example, who consider the Taliban attack on Nobel Laureate Malala Yousafzai a CIA plot or a hoax, intended to undermine Islamic values. Many don’t, or can’t, believe that Osama in Laden was killed only a stone’s throw away from one of Pakistan’s most elite military academies. Instead, they spin dark theories that it was all a set-up to make Pakistan look bad.

“The extremist Islamist ideology has a domestic component as well,” said Haqqani. “There will always be extremists that say, ‘Why are women wearing Western dress? Why are girls going to school?’”

Speaking of schools, Pakistan’s textbooks are full of xenophobic, anti-Western and anti-Shiite sentiments, producing generations of students open to the extremists’ hateful rhetoric. Its blasphemy law, which carries the death penalty, is frequently invoked and just as frequently misused. Many of those accused are religious minorities, and more than 62 have been murdered since 1990, including the governor of Punjab, Salman Taseer.

Haqqani says the military establishment, which can push whatever propaganda it wants through Pakistan’s media, must finally decide to change the message of victimization, threat, and paranoia.

Haqqani is hardly a disinterested observer, to be fair. In 2011-12, he was involved in a controversy when he was ambassador to the United States, in which he was accused of writing a memo to the Pentagon in the days immediately after the killing of bin Laden, asking the United States for help in staving off a military coup. The Pakistani military had been humiliated by the Abbottabad raid, and the mood in the capital, where I was working for Reuters at the time, was tense. A coup didn’t seem completely far-fetched.

In return for asking an ally for help in preserving Pakistan’s weak democracy, Haqqani was branded a traitor on every major television station, prevented from leaving the country, and confined to the prime minister’s residence out of fear for his safety. He was eventually allowed to leave, but he was forced to resign as ambassador and now lives in Washington, effectively in exile.

“Unless there’s a national narrative change, we will continue to have tragedies followed by anger and remorse,” he said. “Instead of cultivating only those elements in the Pakistani discourse that support the jihadi perspective, maybe it’s time for the Pakistani establishment to stop treating the anti-jihadists as its enemies.”