During his Oval Office meeting with Pakistan’s Prime Minister Imran Khan on Monday, United States President Donald Trump characteristically abandoned the script and hailed the Pakistani leader as “great” and “tough”, even promising to help get the former cricketer re-elected. Clearly, the tortured, roller coaster US-Pakistan relationship is back on. The new bilateral bargain seems to be this: if Islamabad can deliver Washington an honourable exit from Afghanistan that addresses its main counterterrorism concerns, the Trump administration will, in turn, restore military aid and take active steps to expand trade. Against the backdrop of the intensifying US-China rivalry , Washington’s relationship with Islamabad is of particular consequence for Beijing, given the decades-long alliance between China and Pakistan . Imran Khan’s China play threatens Middle East headache for Beijing On the whole, Beijing benefits from better relations between Islamabad and Washington. Chinese officials have regularly counselled their Pakistani counterparts to preserve ties with the US, even in the aftermath of the Osama bin Laden raid, which humiliated Pakistan. Deep mutual trust underpins the China-Pakistan relationship, so renewed communication between Islamabad and Washington is unlikely to make Beijing anxious – although China’s hand has been strengthened by their strained relations in the past. Repeated suspensions of US military assistance have pushed Islamabad further into Beijing’s arms, driving the overall surge in Chinese weapons exports. From 2008-17, Pakistan was the No 1 buyer of Chinese arms sales, with its expenditure of about US$6 billion, accounting for 42 per cent of China’s total weapons sales. More generally, China’s flexibility has allowed it to position itself as a less intrusive partner than the West. Its willingness to provide countries with infrastructure financing without requiring environmental standards and to sell arms without regard for human rights violations underpins its soft power. In Pakistan specifically, China’s economic assistance, diplomatic support and military aid offers an alternative to the “unreliable” US, enabling Islamabad’s deterrence of arch-rival New Delhi and “strategic defiance” of Washington. Reflecting Beijing’s role as geostrategic insurance or superpower ally of last resort, envoys from 37 states – including more than a dozen Muslim-majority countries – earlier this month signed a letter to the UN Human Rights Council endorsing China’s repressive policies targeting Uygurs in the Xinjiang region. With Modi back in power, can India and Pakistan achieve peace? However, China may be hedging on its “no strings attached” approach when it comes to Pakistan. The two countries are now each other’s top allies and Pakistan’s security and stability are of utmost importance to China. Beijing’s investment – physical and reputational – is rapidly expanding via the China-Pakistan Economic Corridor (CPEC), which is linked to the vast belt and road infrastructure plan. As a result of irresponsible economic planning by Pakistani policymakers, though, the CPEC has contributed to a balance of payments crisis in Pakistan. Beijing has intervened, ramping up short-term lending to prop up the Pakistani rupee. However, the fact there was no broader financial bailout from China has compelled Pakistan to enter yet another programme with the US-dominated International Monetary Fund, which has pushed it to make some painful economic reforms. Indeed – when it comes to Pakistan – China and the US have joined in an informal “burden-sharing” arrangement. Washington has, for its part, adopted a very public hands-on, “carrot and stick” approach focusing on counterterrorism, governance reform, human rights and democratisation. Among these issues, counterterrorism and governance reform matter most to China. In contrast to the US, China has largely avoided discussing these matters in detail and has benefited from US-Pakistani operations against al-Qaeda and groups such as the Turkestan Islamic Party. Washington, unwittingly, has provided Beijing with a reputational buffer by assuming or falling into the role of the “bad cop” and publicly chastising Pakistan for falling short on its obligations on issues such as counterterrorism. For example, the US led the effort last year to place Pakistan on the Financial Action Task Force grey list. At the last minute, China withdrew its opposition to the US campaign, enabling Pakistan’s greylisting without having led the charge. Young Pakistani brides lured to China face life of sexual slavery Pakistan currently holds China to a more lenient set of standards than it applies to the US – but that may change. Chinese companies, workers, and material have flowed into Pakistan for CPEC construction. These firm enjoy high returns on investment while Pakistani consumers foot the bill for security guarantees. China is not pursuing a “debt trap” model in Pakistan but CPEC is by no means an exercise in altruism. Indeed, China and Pakistan may be too close for comfort: China is Pakistan’s largest creditor and its footprint is growing, exposing it to some of the same risks taken previously by the US, including the deployment of private security contractors. Renewed US-Pakistan cooperation could therefore allow China and Pakistan to better calibrate the trajectory of their relations. A US-Pakistan “reset” may ease pressure on Pakistan at the Financial Action Task Force and other international forums. Likewise, renewed aid and investment would not only improve stability in Pakistan and reduce Islamabad’s dependence on Beijing, it will make Chinese aid and investment in Pakistan – worth billions of dollars – more secure. Khan and Trump were all smiles on Monday – and if this new warmth endures it’s likely to help rather than hurt the China-Pakistan alliance. Arif Rafiq (@arifcrafiq) is a non-resident fellow at the Middle East Institute and president of Vizier Consulting, LLC, a political risk advisory company focused on the Middle East and South Asia. He is author of The China-Pakistan Economic Corridor: Barriers and Impact Connect with us on Twitter and Facebook