The bloody assault on a police training college in Quetta by a team of suicide attackers is another reminder that, for all its progress against militants in the past two years, Pakistan remains vulnerable to terrorism.
It comes at a time of looming political crisis in Islamabad, the shunning of Pakistan by its regional neighbours and a renewed rift between the government and the military establishment.
Dozens were killed and well over a hundred wounded by the late night attack on a hostel where hundreds of police cadets were sleeping.
It was the third time the facility had been attacked in the past decade. It was also the second devastating assault on an education facility since the December 2014 massacre by Pakistani Taliban gunmen of more than 130 schoolboys at the army public school in Peshawar.
That heralded a harsh crackdown on domestic militant groups, the unveiling of a “national action plan” against terrorism and added security for schools and colleges, which were all ordered to build tall perimeter walls.
Rates of violence fell overall and the army chief, Raheel Sharif, was glorified as a national saviour. But attacks have continued, including major ones such as the bombing of a Quetta hospital in August that killed 73 people. The country also remains as politically unstable and crisis prone as ever.
The opposition leader, Imran Khan, and the religious leader Tahir-ul-Qadri are preparing for a rerun of their 2014 mass protests, which brought the capital Islamabad to a standstill for four months.
They say they will shut down the capital with protests beginning next Wednesday.
Khan, the leader of the Pakistan Tehreek-e-Insaf (PTI) and Qadri, leader of the Pakistani Awami Tehreek (PAT), say they are protesting about financial sleaze allegations against the prime minister, Nawaz Sharif, following revelations in April that his children owned valuable London properties through offshore companies.
However, Khan’s statements in recent days suggest he is determined to provoke a crisis that will force Sharif from power, perhaps with the help of the army, which has kicked out civilian governments several times during the country’s 69-year history.
The PTI leader has picked an extremely sensitive time for his protests. The prime minister must select a successor for the hugely popular Raheel Sharif, who is due to step down at the end of next month. Although the army chief has said he does not want to delay retirement, there have been widespread calls for him to continue in office.
His supporters say the country cannot afford a change in the military command at a time of continuing security challenges, not least from India, which on 29 September launched what it called retaliatory surgical strikes against alleged terrorist “launch pads” inside the Pakistani-held portion of Kashmir, the Himalayan region both countries lay claim to.
The prime minister’s ruling faction of the Pakistan Muslim League (PML-N) is still reeling from its latest confrontation with the powerful military establishment following an incendiary newspaper article published in Dawn on 7 October that leaked details of a high-level security meeting.
The respected journalist Cyril Almeida reported that the government had delivered an unprecedented dressing down to top generals, warning them that their policy of protecting jihadi groups that use Pakistani soil to fight in Afghanistan and India was leaving the country internationally isolated.
As if to underline the government’s inability to confront the problem, a group of notorious Islamist clerics will hold a rally in Islamabad on Friday intended to “pay tribute to those who have devoted and sacrificed their lives for the protection of Islam”.
They include Hafiz Saeed, the leader of Jamaat-ud-Dawa, a sister organisation of Lashkar-e-Taiba, which was responsible for three days of terrorist attacks in Mumbai, India, in 2008 that killed 164 people.
Senior generals are said to be furious with the government, which they believe leaked details of the meeting to Dawn in order to weaken the army, damage its reputation and curry favour with western governments.
The army has also smarted at the suggestion Pakistan is internationally isolated, even though India, Afghanistan, Bangladesh and Bhutan have all announced a boycott of an important regional summit that was due to be held in Islamabad next month in protest at what they say is Pakistan’s continued use of militant groups.
Good relations with Afghanistan are crucial if Pakistan is ever to get its jihadi problem under control – on Tuesday morning a top security official in Balochistan claimed the Quetta attackers were in continuous communication with handlers based over the border in Afghanistan.
But Kabul remains deeply alienated from Pakistan following the failure of peace overtures by the Afghan president, Ashraf Ghani, shortly after he was elected.
A Pakistan-brokered programme of peace talks with the Afghan Taliban failed to get off the ground and insurgent violence inside Afghanistan only increased.
Nawaz Sharif has a long and turbulent history with the army, having been thrown out of power in a coup by the then army chief, Pervez Musharraf, in 1999.
Sharif ordered an unprecedented high treason trial for Musharraf when he returned to power in 2013, provoking a major confrontation with the army.
Things deteriorated further when the PML-N was perceived to have supported Geo, part of a major pro-government media group, when it broadcast incendiary allegations in 2014 that the army’s top intelligence officer had conspired to assassinate one of its best known journalists.
Bombs in Balochistan and street protests in Islamabad could provide the army with the perfect opportunity to cut the prime minister back down to size.
Jon Boone in Islamabad