In 1992, when Pakistan first came under international diplomatic pressure to halt terrorist attacks on India emanating from its territory, Islamabad’s chief diplomat and the architect of its modern-day strategic alliance with China, Akram Zaki, told me: “Pakistan’s foreign policy is in a minefield without a map”. It still is.

By naming Pakistan-based terrorist groups in the declaration issued at the end of the BRICS leaders meeting in Xiamen on Monday, China has publicly reminded its all-weather ally that the time has come for it to put an end to its relationships with non-state actors.

Coming two weeks after US President Donald Trump issued a humiliating ultimatum to Islamabad, and ahead of a diplomatic support-seeking tour of Beijing, Moscow, Ankara and Tehran by Pakistani Foreign Minister Khawaja Mohammed Asif, the timing and multilateral context of the message is definitive.

Is Trump driving Pakistan deeper into China’s orbit?

China may be working overtime to help Pakistan negotiate a way out of a diplomatic dead end, in part to protect its multibillion-dollar “Belt and Road” investments, but the onus is on Islamabad to come to terms with the changing realities of Asian geopolitics.

The most daunting challenge for Pakistan is to come to terms with the folly of a self-defeating narrative which paints Afghanistan and India as bigger sponsors of cross-border terror than itself.

While there is considerable truth to the Pakistani assertion that dirty wars are being waged against each other by most states with a stake in the “Great Game” in Afghanistan, two wrongs do not make a right. Besides, China has stayed above the fray, making its growing role as a neutral arbiter acceptable to all.

Nor does it help Pakistan that its almighty military leaders refuse to allow a constructive introspection of their dubious policies. They reacted vindictively when leading English-language newspaper Dawn last October cited Foreign Secretary Aizaz Chaudhry as telling a meeting of civil and military leaders that China had “indicated a preference for a change in course” of Pakistan’s handling of jihadist groups.

Rather than heed Chaudhry’s advice, the military accused the government of conspiring to humiliate it and forced then prime minister, Nawaz Sharif, to sack Information Minister Pervaiz Rasheed for leaking the story. The newspaper was vilified as “anti-state” and social media activists critical of the military were disappeared and allegedly tortured.

They were painted as traitors and blasphemers, making them vulnerable to assassination by extremists.

But it’s one thing to force a narrative down the throats of a captive domestic audience, another to expect foreign governments, friendly or otherwise, to buy into one.

Trump beware: Pakistan’s luck playing China card is turning

In the aftermath of the Trump ultimatum, Pakistan misinterpreted Chinese statements of moral support as unconditional backing for its untenable diplomatic position. Pakistanis were even led to believe China’s diplomatic backing would render the country immune to feared acts of American retribution for Taliban and Haqqani network attacks planned on Pakistani soil.

The falsehood of the narrative was exposed by the Xiamen declaration because its wording, rather than being a sudden change of China’s position, was a facsimile of the statement signed last December by all the participants of an India-hosted round of the “Heart of Asia” multilateral conference on Afghanistan, including China and Pakistan.

The subsequent “rejection” of the BRICS declaration by Pakistani Defence Minister Khurram Dastgir Khan on Tuesday was another bizarre example of how denial is undermining the credibility of Islamabad’s position.

Foreign Minister Asif did well to limit the damage by countering that Pakistan should “put its own house in order rather than embarrassing its friends”.

At the heart of it all lies Pakistan’s refusal to acknowledge cross-border terrorist activity continues to be conducted from its territory. This is emblematic of the country’s lack of leadership, which is the product of the deep internal divisions created by incessant bickering between competing arms of the state.

Time and again, terrorist groups have exploited these divisions at great cost to Pakistan. The Haqqani network faction of the Afghan Taliban was largely responsible for prolonging the Pakistani Taliban insurgency in the northwest Waziristan tribal regions bordering eastern Afghanistan, described by the Obama administration as the epicentre of global terrorism. Ultimately, Pakistan had to deploy a third of its standing military to overcome them.

‘ATM Modi’ squirms in Trump’s Afghan embrace

In turn, Afghanistan-focused militants and Pakistani Taliban insurgents have drawn support from anti-India groups in eastern Punjab province, such as Jaish-i-Mohammed and Jamaat-ud-Dawah. They cynically camouflage their terrorist credentials by posing as patriots fighting against India, whereas they have long been part of al-Qaeda’s network. Members of the groups helped Osama bin Laden take refuge in Abbottabad, where he was killed by US special forces in May 2011.

Pakistan’s decisionmakers would do well to revisit the recommendations made by an army task force of three army colonels in 1990 to disarm militants returning from the Afghan jihad against Soviet occupation.

What China has to fear from US drones in Trump’s Afghan search

They were overruled and had to bear the brunt of the fateful decision. Ashfaq Parvez Kayani went on to serve as Pakistan’s army chief of staff for six years at the height of the Taliban insurgency. As chairman of Pakistan’s joint chiefs of staff, Tariq Majid had to endure the kidnapping of his son-in-law by terrorists. Both foresaw that jihadis would undermine the legitimacy of Pakistan’s campaign against Indian rule in disputed Kashmir, the centrepiece of its foreign policy. Pakistan’s present army chief of staff, General Qamar Javed Bajwa, now faces a similar choice.

Tom Hussain is an Islamabad-based journalist and Pakistan affairs analyst