FOR years Pakistan’s government and army put off confronting the Pakistani Taliban and their allied fanatics who had set up what was almost a state of their own in North Waziristan, the wildest of several tribal agencies on the country’s north-west frontier with Afghanistan. The reason for such reluctance was a belief that any attack on the militants would trigger savage reprisals. Imran Khan, a populist politician perhaps most responsible for discouraging military action, has countless times predicted a big “blowback” in the cities.

Yet since the army launched a belated offensive against the militants in North Waziristan on June 15th, the number of terrorist attacks across the rest of Pakistan has fallen by nearly 30%, according to a database maintained by the Pak Institute for Peace Studies in Islamabad, the capital. Deaths from terrorism are down by more than half compared with the same period in 2013.

Indeed, the widespread assumption is that Operation Zarb-e-Azb, named after a sword of Muhammad, has badly undermined Pakistan’s militants. Independent confirmation is impossible, but the army claims it has killed more than 1,100 terrorists in North Waziristan. (More implausibly, it also claims that its “precision” air strikes have killed precisely zero civilians.) Militants appear now to have lost what was once a secure sanctuary where fighters could be trained and suicide-bombers groomed for self-destruction. The army says that more than 40 of its soldiers have been killed in the course of capturing key towns in North Waziristan, notably Mir Ali and the agency’s capital, Miran Shah. The campaign adds to the steady progress Pakistan has made in recent years in restoring its writ over the tribal areas, nearly a third of which were controlled by militants in 2007-08, the army says.

Meanwhile, the Pakistani Taliban, an umbrella organisation of militant groups officially known as Tehreek-e-Taliban Pakistan (TTP), may have all but fallen apart. For that, perhaps, the United States is as much to thank as the army offensive. Nearly a year ago a CIA-operated drone managed to kill Hakimullah Mehsud, the long-haired tribesman who had run the group since 2009. His death sparked a bitter succession struggle, with the leadership eventually passing to Mullah Fazlullah, a militant who masterminded the Taliban’s takeover of his homeland of Swat, once a popular holiday destination, in early 2009.

Mr Fazlullah has since been unable to hold together an organisation traditionally ruled by members of the Mehsud tribe. For his own safety against government attacks, he moved to eastern Afghanistan, a choice that earned him disparagement among fellow jihadists. Meanwhile, disagreements grew over whether the movement should negotiate with the Pakistani government. To date four separate groups have split off from the original TTP, two later merging with each other. They have taken much of the TTP’s fighting force with them.

In September a group calling itself the Punjabi Taliban announced that it would abandon domestic terrorism in favour of preaching and waging war in Afghanistan instead. Some analysts took that as a sign that Pakistan’s military spy agency, the Inter-Services Intelligence directorate (ISI), has had some success in directing the energies of militants towards creating chaos elsewhere in the region.

A long-standing ISI policy of fighting only those seeking to topple the Pakistani state while tolerating or even supporting groups on Pakistani soil that restrict their violence to Afghanistan and India has long been a source of despair to Pakistan’s Western allies. They point out that, wherever they operate, militants with bases in Pakistan share ideas, fighters and often allegiances. Western spooks appear convinced that the Haqqani network, a particularly lethal Afghan insurgent group, received ample warning and even assistance from the ISI in making their escape from bases in North Waziristan before the launch of Zarb-e-Azb.

Sowing further discord among the jihadists is the excitement generated by the success of Islamic State (IS) in conquering swathes of territory in Syria and Iraq. Leaflets praising IS and declaring Pakistan, Afghanistan and bits of India to be part of a caliphate have been circulated in Pakistan’s north-western city of Peshawar. This month six senior TTP leaders announced that they had declared their allegiance to IS’s “caliph”, Abu Bakar al-Baghdadi.

As for al-Qaeda, the terrorist group now in competition with IS for leadership of the global jihad movement, it is attempting to shore up its position in Pakistan, where American drones have killed many of its leaders. Last month the group announced a new franchise, called al-Qaeda in the Indian Subcontinent. However, its first big operation, an apparently overreaching plan to hijack a Pakistani frigate and attack American warships, came to naught after it was foiled by a guard.

Although the army’s battlefield success, splits in the TTP’s ranks and a tug-of-war between IS and al-Qaeda have reduced violence in Pakistan, hopes of this lasting are not high. Jihadist militancy has a record of evolving for the worse, and the especially loathsome tactics of Islamic State may inject a new radicalism into Pakistan’s already ferocious militant groups. And for as long as the army’s spy agency continues to regard some militants as helpful to its regional designs, then Pakistan is unlikely to be properly at peace.