Saudi Arabia’s investment tour in Asia last month added momentum to its economic shift east, but deals with China herald the most significant change. And while the Saudis aspire to retain stable relations, China will have to be shrewd to remain fluidly diplomatic in a variety of situations.

King Salman finished his tour in China, signing US$65 billion worth of agreements on his first day with the kingdom’s largest oil-export customer. The two countries also agreed to a number of memorandums of understanding (MoU) affecting their respective oil industries. These included:

— Saudi Aramco and China North Industries Group Corp. to develop refining and chemical plants in China;

— Saudi Basic Industries Corp. and Sinopec to further develop petrochemical projects in both China and Saudi Arabia, and;

— Aramco and Aerosun Corp. to make reinforced thermoplastic pipes and components.

The MoU’s will also see Saudi participate in China’s Chang E-4 moon mission, and partner with China in the manufacture of drones. Aside from the MoU’s, Saudi and Chinese companies signed 21 deals, ranging from exploring investments in oil and petrochemical plants to e-commerce and cooperating in renewable-energy markets.

The Saudis were looking to boost oil sales to China, the world’s second-largest oil market, after losing market share to Russia last year, due to a US$400-billion energy agreement between China and Russia. The Saudis also want to promote investment opportunities in the kingdom, including the sale of a stake in Aramco, the kingdom’s oil company.

Was Saudi Arabia’s Asia tour successful? Yes, because the Saudis’ strategy to expand its refining and chemicals businesses to help diversify its assets and secure new long-term agreements for its oil was enabled by Beijing loosening its grip on its oil sector in an effort to boost private investment as the Chinese economy cools.

Old friends with huge potential.

Chinese President Xi Jinping and King Salman were described as old friends, with Chinese officials stating that “practical cooperation between China and Saudi Arabia has … huge potential.”

For the Saudis, that potential is getting China to invest in their economy which has suffered from sagging oil prices squeezing their dependent petro-economy. And the Saudis are dipping into cash reserves to buy weapons as it continues a costly conflict against rebels in Yemen.

The Middle East is diversifying. Qatar and the UAE, with countering foreign policies and rivals, are leading the way. Saudi’s neighboring sheikdoms and emirates have diversified into Europe and elsewhere in industries such as aeronautics, airlines, sports, and media. Saudi is playing catch-up — thanks to its aging monarch and his designated crown prince, Muhammad bin Nayef, who have led the move towards using the 30% dormant female labor workforce, something unthinkable a decade ago.

That’s why the Saudis didn’t just pen oil deals, but also drone manufacturing, chemical development — even space exploration. They’re trying to increase their commercial relationship with China beyond energy exports, diversifying the economy just like the UAE and Qatar have in Europe. But Saudi Arabia is looking east, where capital investment is plentiful and the kingdom’s poor human-rights record won’t bring E.U. criticism. Another potentially huge mutual benefit for both China and Saudi Arabia is the move away from the global US-dollar hegemony. Saudi Arabia has begun accepting Chinese yuans for oil and can use yuans to purchase Chinese-made goods, or swap yuans for euros.

What does China want from its ‘old friend?’

The Chinese want to further assume the role of “honest broker” in the Middle East where its diplomacy and lack of historical interest exempt it from age-old baggage, unlike the Americans or the Europeans.

Further aligning itself with Saudi Arabia may allow the Chinese to persuade Riyadh to cease supporting insurgents, rebels, jihadists and other factions that are battling Syrian President Bashar al-Assad. Syria was essential to China’s New Silk Road, and the Chinese want it to remain so. In exchange, last year in a bid to endear itself to the Saudis, China offered support for Yemen’s government in its campaign against rebel Houthis. The Yemeni government is backed by a Saudi-led Gulf-Arab coalition. However, China has to placate Iran, which supports the Shi’ite Houthis and is of strategic importance to China, more so than Saudi Arabia.

The Chinese also want their “old friend” to douse the flames of fanatical Takfirism in the Sunni world. Making the Saudis dependent on Chinese capital gives Beijing the soft power it’s so renowned for using to its own ends. The Saudis won’t want to lose that capital-rich friendship, and being the anointed leader of the Sunni sect could aid in stifling covert support for Islamist factions in the Chinese autonomous region of Xinjiang or for Islamists in adjoining East Turkestan. China is concerned about Xinjiang, its Muslim dominant far-western province. The region is pocketed with Islamist groups seeking support from Wahhabist and Salafist backers. Its western frontiers are awash with ever-increasing numbers of radicalized Takfiri.

The threat to Chinese unity and Beijing’s attempt to equate Chinese with the Han sect is jeopardized in Xinjiang, so isolating support from Saudi Arabia to the idea of East Turkestan will preserve Chinese integrity. If China has influence in Saudi Arabia, it can have a say in the Muslim world. That will leave only Turkey as a major supporter of the idea of East Turkestan.

Although China is reliant on coal and doesn’t have much oil, it is increasingly clear that the country has abundant deposits of natural gas in reserve. The topography makes pipeline construction a challenge so China will remain an oil importer for some time while it builds the infrastructure need to open up reserves.

The Saudis can only hope the Chinese will continue to play a greater role in the Middle East, with its huge industrial capacity and investment in the Silk Road Economic Belt whose aim it to link China with Middle East markets. Saudi’s relationship with China is in its honeymoon phase, but the kingdom will learn soon enough who will direct the “friendship.”

Andrew Brennan is a dual Irish/American citizen who was educated in Ireland. He holds two Master of Arts degrees from the National University of Ireland, Galway. He has experience in radio, research, and domestic television, and also currently contributes to Forbes and Global Times.