In most countries, governments change and policy follows. In China, where the Communist Party is determined to stay in power for perpetuity, the government can lay down policies and carry them out over the long haul. The long-term policy can be upgraded as the economy and technology permit.

This is happening with China’s ambitious One Belt, One Road project, and its all-weather alliance with Pakistan, the latest example being active involvement  in helping Islamabad bring the Afghan government and the Taliban to the negotiating table officially for the first time.

Containing India

After the 1962 Sino-India War, Chairman Mao Zedong decided to contain India’s regional clout by forging an alliance with its rival Pakistan, even though the latter was then firmly in the “imperialist” camp of the United States. This alliance is now being given a new varnish as part of the modern Silk Road network aimed at extending China’s economic-strategic influence to the Indian Ocean region.

The enduring stability of Sino-Pakistan ties stems from mutual interest in containing India. Strained relations between the two South Asian neighbors date back to the founding of Pakistan on the eve of the independence and partition of British India in August 1947. Since then Pakistan, the smaller of the twins, has struggled to even up to its larger, more powerful sibling. In this quest, it has found China a pivotal ally.

Whereas Washington has had wildly fluctuating relations with Islamabad, Beijing has proved to be its all-weather ally. In May 2011, when Pakistan protested that the United States had not given it the merest hint of the impending clandestine operation to kill Osama bin Laden in Abbottabad, there was silence in capitals worldwide – except Beijing. China supported Islamabad’s stance, arguing that Pakistan had been foremost in combatting terrorism at home. This led Pakistan's ambassador to China, Masood Khan, to laud the Sino-Pakistani friendship. “We say it is higher than the mountains, deeper than the oceans, stronger than steel, dearer than eyesight, sweeter than honey, and so on.”

Pakistan’s location has been a key factor in the geopolitical alliance. On the edge of the Persian Gulf, Pakistan offers a bridging role for China. Pakistan’s ports overlooking the busiest oil shipping lanes have been a key element in China’s implementation of its “string of pearls” strategy linking the South China Sea, South Pacific Ocean and Indian Ocean. Aiming initially at safeguarding the sea lanes used to ferry Middle East oil for its voracious industry and rising living standards of its people, China has come to view Pakistan as a critical element in containing India on a wider scale.

China-Pakistan Economic Corridor

According to China’s ambitious plan, the westernmost pearl in its string of pearls is Gwadar port, to be linked by rail and road to the Chinese city of Kashgar, end points of the proposed China-Pakistan Economic Corridor, or CPEC. Gwadar is 386 kilometres from the Strait of Hormuz through which about 30 percent of world oil shipments pass daily. China aims to import Middle East petroleum through Gwadar, thus discontinuing reliance on the long, expensive sea route, exposed to potential blockade of the Malacca Straits by the US Navy.

The CPEC project – a network of roads, railway and pipelines – moved up from blueprints in April when Chinese President Xi Jinping and his senior officials signed 51 agreements with Pakistan, 31 related to CPEC to which China has committed an investment of $46 billion.

Deviating from diplomatic protocol, Pakistan’s military chiefs called on Xi during his Islamabad visit, to thank him for ongoing Chinese cooperation with their forces dating back to 1966. Following the Indo-Pakistan War in disputed Kashmir in 1965, Washington suspended supplies of war materials to both belligerents even though Pakistan continued to be a member of the US-led South East Asia Treaty Organization and the British-led Central Treaty Organization. China stepped in to fill the gap, shipping weapons to Pakistan and participating in the building of its domestic arms industry.

Following the Soviet military intervention in Afghanistan in 1979, Pakistan, then governed by General Muhammad Zia ul Haq, became a frontline state in the Cold War. The US under President Ronald Reagan resumed arms supplies to Pakistan subject to the US Nonproliferation Act of 1978 which barred any country testing a nuclear weapon from receiving American assistance and imposed sanctions against countries that attempted to acquire unauthorised nuclear technology.

This did not stop Islamabad from seeking clandestine assistance for its nuclear weapons program from Beijing. Intent on helping Pakistan to overcome military inferiority compared to India, China provided Pakistan by providing an atom bomb design and fuel. In early 1984, a nuclear bomb assembled by Pakistan was detonated successfully at the Chinese test site of Lop Nor in Xinjiang. With that, much to Beijing’s contentment, Islamabad achieved parity with Delhi in military deterrence.

So single-minded was Reagan in expelling the Soviets from Afghanistan that he ignored the CIA’s 1986 reports of the secret testing of a Pakistani atom bomb in China. Military aid to Islamabad continued subject to the US chief executive certifying each fiscal year that Pakistan was not engaged in a military nuclear program.

This charade ended soon after George WH Bush, a former CIA director, became the US president in 1989. With the Afghan war ending that year, he refused to certify that Pakistan did not possess a nuclear explosive device. US weapons shipments ceased in October 1990.

That opened Pakistani gates for Chinese arms manufacturers. Within a few years, China became Pakistan’s leading arms supplier. Now Islamabad-Beijing collaboration includes personnel training, joint military exercises, intelligence sharing and counterterrorism efforts. Since 2010, Pakistan has produced the JF-17 (Joint Fighter) Thunder multi-role combat aircraft and K-8 Karakorum light attack aircraft jointly with China.

Significantly, Xi’s delegation in Islamabad included high officials of the Industrial and Commercial Bank of China, China Development Bank Corporation and EXIM Bank of China – in line with the China’s Politburo to have an increased economic footprint in the Indian Ocean region.

Targeting Indian Ocean

As a result of this policy, China replaced India as the largest investor in Sri Lanka in 2013. China has embarked on a $1.3-billion project to build an artificial island off Colombo – a port city that will become a major stop on China’s maritime route. Twice in fall of 2014, Chinese attack submarines docked at Sri Lanka’s newly opened, $500 million Colombo South Container Terminal, built and majority-owned by the state-run China Merchant Holdings.

This ran counter to the core of Xi’s speech to the Indonesian parliament in October 2014 when he presented China’s nationalist project as building a “maritime Silk Road” to increase trade and cultural exchanges in the sprawling region.

There was an earlier example of China muscling into Indian Ocean countries where India enjoyed dominant influence. In 2012 the Islamic Republic of Maldives cancelled the building contract for its airport with Indian construction giant GMR Group and transferred it to a Chinese company. During his September 2014 tour of South Asia, Xi signed an agreement in the capital, Male, to upgrade the airport and build a bridge, housing project and road.

Little wonder that two months later Sri Lanka and the Maldives joined Pakistan to lobby the upgrading of China’s status, from observer to member, in the eight-member South Asian Association for Regional Cooperation. India opposed the move, and they failed.

That failure is unlikely to deter Pakistan from seeking other means of promoting China’s higher profile in South Asia. The relations between Pakistan, where the army has ruled for half of its existence, and Communist Party–controlled China based on mutual geopolitical interests are indeed weatherproof.

Dilip Hiro’s latest book is The Longest August: The Unflinching Rivalry Between India and Pakistan, published by Nation Books, New York and London and distributed by Penguin Random House India in South Asia. Please click here to read an excerpt. This article was originally published on Yale Global. Rights: Copyright © 2015 YaleGlobal and the MacMillan Center