The twin suicide bombings of a church congregation in Peshawar on Sunday have brutally dispelled the naive optimism of Pakistan, a country that believed Nawaz Sharif, the prime minister, when he campaigned to “give peace a chance” in May’s general election.

The murderous Taliban attack has rattled Pakistan to its core, and sparked a debate on national and religious identity. If allowed to run its course, it could create a narrative in which secular patriotism and common morality would end the abusive reign of pseudo-Islamist oppression against Pakistan’s minorities, be they Muslims other than devout Sunni, ethnic groups other than Punjabi, religious minorities or women.

The war for possession of Pakistan’s soul has been waged by its overbearing military since 1956, when the first of four juntas took power and, for the sake of its political longevity, picked a 1965 war with India over Kashmir.

Similarly, when the second military ruler was confronted with a 1970 election victory by ethnic Bengali separatists, it unleashed militant activists of the Jama’at-i-Islami party on the population of what was then East Pakistan. The subsequent pogrom cost a million lives and eventually led to the creation of Bangladesh.

The third military coup took power in 1977, and repressive laws replaced the democratic constitution. In time, religious militancy was championed as a counter to the Soviet occupation of Afghanistan, leading the creation of the Taliban and Al Qaeda.

The fourth junta took over in 1999 and managed to tread a duplicitous path through all the years leading up to the eventual western exit from Afghanistan.

Not surprisingly, Pakistanis are deeply confused about the entire issue of religious militancy. According to opinion polls conducted during the run up to the May elections, nearly half of the population still believed that the Taliban were good guys, despite a six-year insurgency that has cost more than 40,000 lives and Dh200 billion.

To date, the Pakistani state persists with promoting the false concept of “good” and “bad” Taliban. The former category includes the Afghan Taliban and Pakistani militant groups opposed to India, like the Lashkar-i-Taiba, because their strategic goals coincide with Pakistan’s. The latter consists the Tehrik-i-Taliban Pakistan and other Al Qaeda-affiliated militant groups that have turned on the Pakistani state.

Playing that tune, Mr Sharif and his right-wing rival Imran Khan, a cricket star turned leader of the Movement for Justice party, had promised voters to persuade the bad Taliban to lay down their arms and have them return to the fold. Those promises helped win Mr Sharif a parliamentary majority and enabled Khan to take control of the north-west Khyber-Pakhtunkhwa province, which has borne the brunt of the TTP insurgency.

The concept of better or worse Taliban has also found an international market, as demonstrated by Pakistan’s recent release of detained Taliban leadership figures, as part of a joint initiative with the United States and Afghanistan to revive the stillborn Doha peace process. Mr Sharif’s adviser on national security and foreign affairs, Sartaj Aziz, even suggested the Taliban should be asked to cajole their TTP counterparts into negotiations.

The falsehood of that rhetoric was exposed by Sunday’s murderous attack, which has fuelled a long overdue national debate sparked by the assassination the previous Sunday of a two-star army general, just a few days after Pakistan’s political parties backed Mr Sharif’s proposal for unconditional talks with the TTP.

Mr Sharif’s emotional reaction to Sunday’s church bombing contained key words: the TTP were reclassified as “enemies of Pakistan” and virtually labelled apostates for acting in contradiction of Islam and all other faiths. Overnight, the TTP was deprived of its Taliban co-branding and any perceivable moral justification.

Pakistanis are now asking meaningful questions of their government. In the absence of a reliable version of the country’s 66-year history, many have returned to the country’s origins.

They have latched on to speeches by Pakistan’s founder, Mohammed Ali Jinnah, who famously declared that “religion is not the business of the state”.

They have also discovered that Jinnah was an Anglophile barrister who used his understanding of British constitutional law to lobby for the creation of a separate homeland for India’s Muslim minority in 1947. His tactics were in stark contrast to his rivals, Mahatma Gandhi and Jawaharlal Nehru, who used campaigns of non-violent resistance to pressure the British colonial government to quit India.

Jinnah was also renowned for his disdain for Muslim cleric-politicians, practically all of whom opposed the creation of Pakistan. They subsequently collaborated with military dictators to corrupt Islam’s teachings for use as instrument of political oppression.

Ironically, many such unscrupulous clerics have sensed the marked shift of the Pakistani public’s mood, and are now rolling out one Islamic tenet after another to establish the apostasy of the TTP and its Al Qaeda-affiliated allies.

Therein lies the catch. The Pakistani government, and military in particular, lacks the resources and diplomatic clout to influence future events in Afghanistan without using the Taliban as a proxy to neutralise other regional players such as India. Pakistan must also secure its border with Afghanistan before the withdrawal of US-led combat troops next year, which suggests a decisive military operation in the Taliban-infested tribal area of North Waziristan.

Ultimately, the next move depends on where the current shift in Pakistani public opinion stops.

Tom Hussain is an Islamabad-based freelance journalist