The umpire was on his side and the field had been set in his favour – there was little that stood between Imran Khan and power. And China took no chances. Even as Khan was taking his run-up to this week’s much discredited election, Beijing took its guard, preparing against any nasty inswingers the former pace bowler might spring on Pakistan’s staunchest ally.

The prospects for the China-Pakistan Economic Corridor (CPEC), the flagship of President Xi Jinping’s B elt and Road Initiative, “has triggered widespread speculation amid the West’s repeated hype of China’s ‘debt traps’,” said China’s state-run Global Times. “Beyond doubt, Beijing expects a higher degree of engagement by the new Pakistani government in the CPEC,” wrote Liu Lulu, described as a Chinese “expert” in retweets posted on election day by Lijian Zhao, the deputy chief of mission at the Chinese embassy in Islamabad.

Beijing has long been suspicious of Khan. His party, known as the PTI after its Urdu-language acronym, staged a five-month sit-in in the government district of Islamabad in 2014, forcing a one-year postponement to the scheduled visit of President Xi Jinping at which he was to unveil the CPEC master plan to connect Xinjiang to the Arabian Sea.

In Pakistan’s currency crisis, China is the problem and the solution

Chinese diplomats have lobbied the PTI intensely since, but with limited success. The master plan for CPEC was expanded in 2015 in response to complaints that it ignored northwest Khyber Pakhtunkhwa province, administered by a coalition led by Khan’s party. By then, however, PTI activists had joined prominent Pakistanis questioning whether CPEC was a modern-day equivalent of the East India Company, which ruled the Indian subcontinent in the 19th century.

The PTI subsequently toned down its rhetoric, but indirectly attacked CPEC by persistently criticising Chinese-funded mass transit projects in three cities of the populous eastern Punjab province, governed by chief minister Shahbaz Sharif, brother of the recently ousted prime minister, Nawaz Sharif. The PTI characterised the projects as a waste of money that should have been spent on education and health care, and insinuated that corruption was rife in the CPEC projects.

PTI politicians also seized on a fake news story about corruption in a CPEC-funded bus project in the central city of Multan last year, drawing an angry public riposte from China. Sheikh Rashid Ahmed, a close ally of Khan, has declared he intends to investigate a CPEC power generation project for evidence of corruption by Shahbaz Sharif.

Pakistan’s new boss will be bossed just like the old boss

The politics over CPEC can only intensify in the coming months as the Sharif brothers’ Pakistan Muslim League-Nawaz has joined hands with most of the country’s other established political parties to protest against the alleged rigging of this week’s election bringing Khan to power. Election staff are said to have slowed the process at many polling stations by limiting the number of voters allowed into the premises and denying the long queues of people the opportunity to cast their ballots. The counting process has been similarly tainted, with claims that opposition polling agents in key constituencies had been forced out and votes stolen blatantly. Provisional results released by the Election Commission of Pakistan showed Khan’s PTI had won 116 of the 260 declared seats (in a house of 270).

“I’ve been covering elections for 30 years. Never seen anything as disgusting as this,” tweeted editor Aamer Ahmed Khan. “If I was part of an institution tasked with rigging an election, I would be seriously worried about my own competence after tonight’s performance.”

Maulana Fazal-ur-Rehman, the chairman of a group of Pakistan’s most influential Islamist parties, has launched efforts to form an opposition alliance to seek a fresh general election without military interference, making a campaign against the PTI government inevitable.

China is central to the first governance challenge facing Asad Umar, the PTI’s finance minister in waiting. What he will have to address is a balance of payments crisis sparked, in part, by record imports of Chinese machinery for CPEC projects. The crisis has been held at bay by a series of emergency loans from Chinese state-owned banks.

What do you get if you cross Pakistan’s Game of Thrones and China’s Belt and Road?

A leading critic of the last government’s borrowing levels, Umar would have to reach an understanding with China about remedial measures, including a probable bailout application to the International Monetary Fund. That would entail close examination in the US of the terms of the CPEC financing in the middle of Washington’s trade war with Beijing.

As an austerity programme looms, the Khan administration’s relationship with China will largely be determined by its future spending plans. Mindful of its corruption narrative about Chinese-funded projects, the PTI government in Khyber Pakhtunkhwa province decided last year to develop a bus project in Peshawar with financing from the Asian Development Bank, turning down Beijing’s offer to add it to CPEC.

In his televised victory speech, however, Khan tried to reassure China; it was the first country referred to in the foreign policy portion of his speech and he repeatedly referred to Chinese governance policies as desirable models. “I will send a team to China to learn how it brought 660 million people out of poverty,” he said. He also said he would seek to leverage CPEC to attract wider foreign direct investment and generate employment for young Pakistanis.

Still, Khan’s messaging suggests his views on China and CPEC could “diverge a bit” from the army, as well as the previous Sharif administration, said Michael Kugelman, an associate at The Wilson Centre think tank. “That said, I can’t imagine the PTI trying to take its China policy in a direction that could provoke tensions with Beijing. There is a deep political consensus in Pakistan to maintain and even deepen its embrace of China, particularly as Pakistan’s relationship with Washington goes south.”

In any case, were China ever to find itself at odds with Khan, it does have recourse to the Pakistani military, the ultimate umpire and Khan’s benefactor. “If the military, which has the final say on foreign policy, feels the PTI is going astray, it would likely rein it in,” Kugelman said.