IT WAS only a matter of time before Donald Trump, with his deep conviction that foreigners are taking America for a ride, discovered Pakistan. “The United States has foolishly given Pakistan more than 33 billion dollars in aid over the last 15 years, and they have given us nothing but lies & deceit,” America’s president raged in his first tweet of 2018. “They give safe havens to the terrorists we hunt in Afghanistan…No more!” On January 4th America announced that it would suspend most security assistance to Pakistan pending a more credible effort to expel the Taliban and other enemies of Afghanistan’s government from the Pakistani side of the two countries’ long border.

The State Department estimates the suspension will cost Pakistan $2bn in aid already budgeted. It is similar to many previous American efforts to change the behaviour of the generals who dictate Pakistan’s security policy. The administration of Barack Obama froze aid to Pakistan several times for the same reason—the generals’ refusal to crack down on the militants, chiefly, in recent years, a jihadist network founded by Jalaluddin Haqqani, a former anti-Soviet commander who is based in the Pakistani tribal area of North Waziristan (see map). Mr Obama suspended $800m in aid in 2011 and $300m in 2016. Congress blocked the sale of F-16 fighters to Pakistan the same year.

None of those admonitions worked. Pakistan’s powerful military spy agency, the Inter-Services Intelligence, appears to have pushed the Haqqani network from Miran Shah, North Waziristan’s capital, farther towards the lightly monitored frontier. But the generals are reluctant to squeeze harder. They fear more blowback of the sort Pakistan has suffered from previous campaigns against militants. Since 2003 around 30,000 Pakistani soldiers and civilians have been killed by jihadists.

What is more, Pakistan’s army has long considered Islamist militants as useful auxiliaries in their regional rivalry with India. Convinced, not without reason, that Western forces will soon leave Afghanistan, at least some of the generals wish to preserve the Haqqanis and other fighters for future proxy wars there. The fact that India has emerged as an important ally of Afghanistan’s embattled government and also, all Pakistani generals believe, provides increasing support to the militants targeting Pakistan who have found sanctuary in Afghanistan, has hardened that resolve.

America’s latest action is not likely to shift this calculus, even if it is bolstered, as American officials suggest it could be, with more aggressive sanctions, such as rescinding Pakistan’s status as a “major non-NATO ally” or suspending America’s (relatively paltry) development aid. Pakistan’s generals are too focused on their regional concerns and too indignant about American bullying. Moreover, they know they hold a trump card: the power to stop America supplying its forces and the Afghan government via Pakistan. (The only alternative supply route requires Russia’s consent, an equally awkward arrangement.) For this and other reasons, America probably has less influence in Pakistan than at any time since it invaded Afghanistan in 2001.

In particular, its assistance to the country has already been greatly reduced: in 2011 America furnished Pakistan with $3.5bn. Meanwhile, China, which has billed Pakistan as its “irreplaceable all-weather friend”, is increasingly making up the shortfall. It is rumoured to be planning a naval base close to the Pakistani port of Gwadar, on which it obtained a 40-year lease last year. (Both China and Pakistan deny this.) The port is part of a $57bn infrastructure project, the China-Pakistan Economic Corridor, which is intended to connect landlocked western China to the Arabian Sea. America’s leverage with Pakistan looks modest by comparison.