Although the project could have significant long-term economic benefits to the region, it has engendered tensions with India, which has had contentious relations with both China and Pakistan in the past. How China navigates this effort to expand its influence with Pakistan, and how other powerful countries respond, could determine whether South and Central Asia embark on a new era of shared prosperity or remain trapped in a cycle of conflict.

A major target of this redirected effort has been China’s neighbor to its west, Pakistan. A series of joint Chinese-Pakistani infrastructure projects are now underway, branded collectively as the China-Pakistan Economic Corridor (CPEC) . These investments are intended to build Pakistan’s economic capacity and increase its links to western China, while giving China access to port facilities on the Indian Ocean.

After many disastrous years spent trying to shape the Middle East, the Obama administration has refocused its foreign policy toward defending U.S. interests in economically wealthy East Asia. President Obama’s “ pivot to Asia ” is widely perceived as an attempt by the United States to contain China’s growing economic and political clout in that region. But the resulting increase in U.S. pressure on China’s eastern periphery has had an interesting side-effect — it has led China to look elsewhere on the continent for opportunities to trade, invest, and build diplomatic influence.

During a state visit to Pakistan in 2015, Chinese President Xi Jinping signed a series of high-profile agreements for Chinese companies to construct roughly $46 billion worth of highways, ports, and energy infrastructure in Pakistan. The projects are related to a larger Chinese effort to expand its economic and political influence in Asia, known as the Silk Road Economic Initiative. The massive investment in Pakistan is also seen as providing an economic anchor to the longstanding military and political relationship between the two countries.

Speaking to the Pakistani parliament during that visit, Xi highlighted a history of traumatic events that brought the two countries together over the latter half of the 20th century. “Both China and Pakistan suffered from imperialist and colonialist aggression and oppression and we extended mutual sympathy and support to each other,” he said. “We will never forget that Pakistan was one of the first countries to recognize New China and the first Islamic country to enter into diplomatic relations with China.” He noted that in its early years, Pakistan helped the nascent People’s Republic of China circumvent a blockade by foreign powers and claim a seat at the United Nations.

Pakistani politicians have promised that the billions of dollars in Chinese infrastructure projects will be a “game changer” for Pakistan’s economy after years of instability. But the huge political capital invested in the projects has also bred fears that the projects will be undermined by Pakistan’s strategic rivals. The Pakistani military — whose leaders are often unhealthily fixated on India even during calm times — have repeatedly claimed that Indian intelligence agents and their proxies are fomenting attacks aimed at sabotaging CPEC projects.

While views among Indian politicians vary, hawkish figures in the ruling party do tend to view CPEC with trepidation. On India’s Independence Day this August, Prime Minister Narendra Modi gave a speech that seemingly offered support to separatist insurgents in regions of Pakistan where major CPEC projects are located. “Today from the ramparts of Red Fort, I want to greet and express my thanks to some people,” Modi said. “In the last few days, people of Balochistan, Gilgit, Pakistan Occupied Kashmir have thanked me, have expressed gratitude, and expressed good wishes for me.”

Modi’s speech was widely viewed in Pakistan as a threat to undermine CPEC. It was also viewed with alarm in China, where the CPEC investments are seen as both an economic opportunity and a means of stabilizing Pakistan, a neighbor that has teetered uncomfortably close to the brink of chaos over the past decade.

Terrorist attacks in Pakistan have dropped over the past two years following the launch of a major military campaign in the tribal regions, but the country remains beset by a number of serious challenges to its long-term stability and prosperity. China’s investment is viewed as a means of shoring up Pakistan’s economy, creating a new market for its own excess production, and reducing Chinese dependence on other trade routes in Southeast Asia, particularly the Strait of Malacca.

“There is a mindset on China’s part that there is a need to stabilize their western periphery, and that the best means to do so are economic,” says Andrew Small, senior Asia fellow at the German Marshall Fund, a trans-Atlantic think tank. “Chinese state industries have a lot of excess capacity that they are seeking to export. Meanwhile, in Pakistan, the current government was elected on promises to kickstart the economy with grand infrastructure plans and energy projects, so there is a neat convergence of interests.”

Small is the author of The China-Pakistan Axis, a 2015 book analyzing the strategic relationship between the two countries that has developed over the past several decades. Historically, this relationship has been anchored in military and political cooperation at the elite level. Pakistani diplomats famously helped engineer China’s rapprochement with the United States during the Nixon era, while China has long been a source of military hardware and intelligence cooperation for the Pakistani armed forces.

But now China is beginning to view Pakistan as a place to showcase its ability to project soft power as well. Despite its mammoth population as well as its economic and military size, from a political standpoint China remains relatively isolated in its region. Relations with Japan, India, and the ASEAN countries are often contentious, while Chinese patronage of North Korea is generally seen as more of a burden than an alliance. As Small writes, China’s warm relationship with Pakistan is thus seen by Chinese leaders as an outlier, offering a foreign policy relationship that has been “tested out over decades, commands deep support from across the political spectrum and institutions of state, and has a base of public support.”

That relationship didn’t mean much to the rest of the world when China was preoccupied with its own instability. But now that the country has emerged as a major economic and political power, its foreign policy preferences matter a lot more. “China is looking to develop power-projection capabilities in the Middle East, East Africa, and Indian Ocean, to allow it to conduct operations like the 2011 evacuation of its workers in Libya,” Small says. “China needs facilities that Pakistan provides, but there is also a desire to demonstrate that Chinese diplomatic relationships have strong benefits to prospective allies, both politically and economically.”