Like Pakistan, like Turkey. If the university massacre outside the old North West Frontier city of Peshawar was a further sign that Prime Minister Nawaz Sharif is still far from “conquering terrorism”, it is a portent of things to come for Turkey’s far more arrogant President, Recep Tayip Erdogan. For after allowing its borders to be used as a conduit for foreign fighters and smugglers into Syria – just as Pakistan did into Afghanistan after the Soviet invasion of 1979 – Turkey is now experiencing almost as many violent attacks on its people as Pakistan.

Erdogan’s government has increasingly emphasised its Islamic credentials, just as President Mohammad Zia ul-Haq did in Pakistan in the 1970s. And Turkey now finds that the Isis “caliphate” with which it was prepared to treat – allowing it to control part of Syria’s border with Turkey, facilitating Western Muslims wishing to cross in the opposite direction, permitting oil smugglers to bring their produce from Isis-held territory – is assaulting Ankara and Istanbul.

The powerful Pakistani intelligence forces – the infamous Inter-Services Intelligence – sent weapons to the anti-Soviet mujahedin and afterwards co-operated with the Taliban. Indeed, the Taliban managed to infiltrate the Pakistani military and intelligence institutions; and Isis now appears to have some infiltrators within the Turkish state apparatus. In Pakistan’s case, its war with the Taliban is even more complicated, since its own Islamist enemies appear to have several faces. Thus while one “Taliban” group claimed the mass murder at Bacha Khan University in Charsadda, another condemned the attacks as “un-Islamic”.

In pictures: Pakistan university attack Show all 10 1 /10 In pictures: Pakistan university attack In pictures: Pakistan university attack Pakistani rescuers shift an injured man to a hospital following an attack by gunmen in the Bacha Khan university in Charsadda, about 50 kilometres from Peshawar. At least 21 people died in an armed assault on a university in Pakistan, where witnesses reported two large explosions as security forces moved in under dense fog to halt the bloodshed In pictures: Pakistan university attack Rescue workers shout to clear the way for an ambulance transporting injured victims from Bacha Khan University in Charsadda AP In pictures: Pakistan university attack A Pakistani army armoured vehicle (R) enters the Bacha Khan university following an attack by gunmen in Charsadda Getty Images In pictures: Pakistan university attack Pakistani rescuers shift an injured man at a hospital following an attack by gunmen at Bacha Khan university in Charsadda Getty Images In pictures: Pakistan university attack Pakistani troops arrive at Bacha Khan University in Charsadda AP In pictures: Pakistan university attack Pakistani rescuers shift an injured victim outside the Bacha Khan university following an attack by gunmen in Charsadda Getty Images In pictures: Pakistan university attack Pakistani police and onlookers gather in front of a hospital following an attack by gunmen at Bacha Khan university in Charsadda Getty Images In pictures: Pakistan university attack An ambulance carrying injured victims enters a hospital following an attack by gunmen at Bacha Khan university in Charsadda Getty Images In pictures: Pakistan university attack Pakistani rescuers shift an injured man into a hospital following an attack by gunmen at Bacha Khan university in Charsadda Getty Images In pictures: Pakistan university attack Pakistani rescuers carry coffins at a hospital following an attack by gunment at Bacha Khan university in Charsadda Getty Images

But like the assault on the school for Pakistani army officers’ children in Peshawar in 2014, which killed more than 140, the slaughter at Charsadda was a massacre of the innocents. It is easy to explain such bloodbaths as a response to the secular education which Islamist groups despise. But in Pakistan’s case, it was almost certainly a response to further military operations against the Taliban. The Bacha Khan University was named after Abdul Ghaffar Khan, the “frontier Gandhi”, and its Sufi-inspired Islam and Ghandian non-violence made it an obvious target for the Taliban.

Pakistan University attack

David Gosling, who was headmaster of Edwardes College in Peshawar, says that the attacks on education targets “drive a coach and horses” through Pakistani opposition leader Imran Khan’s conviction that the government must negotiate with the Taliban. Pakistan’s dilemma, Gosling says, is “aggravated by its legacy of an earlier commitment to the extended cold war and the likelihood of future Taliban gains in Afghanistan”.