Last week’s Malaysian election result is sending shock waves across the region, not least in China. The surprise outcome is now likely to see a partial reversal of Malaysia’s recent ardently pro-Chinese foreign policy. It also ought to act as a wake-up call for Beijing and prompt a rethink of China’s aggressive US$1 trillion (S$1.34 trillion) Belt and Road Initiative (BRI).

There were many causes of opposition leader Mahathir Mohamad’s May 9 victory over former prime minister Najib Razak. But China’s growing economic clout in Malaysia, and the corruption allegations that came with it, was undeniably a contributory factor. Related Story

Sign up for ST Asia Report newsletter for Malaysia GE updates and other highlights in the region

China is Malaysia’s most important source of foreign investment and commerce, with bilateral trade reaching RM291 billion (S$98 billion) last year. Beginning gradually but moving ever more quickly following BRI’s launch five years ago, China poured billions into rail projects, economic zones and fancy construction schemes.

Tun Dr Mahathir cleverly used these projects to attack his opponents. “They like to flex their muscles a bit and that is very worrisome,” he said last year of creeping Chinese influence. “Without actually conquering the countries, they have managed to increase their influence over many countries in South-east Asia.”

On the stump, he lambasted Chinese initiatives, arguing that they brought few benefits to Malaysians, risked indebtedness and involved influxes of foreign workers. His early target was a power-asset sale to a Chinese company, in a deal designed to pay off debts linked to the mammoth 1MDB graft scandal.

Other Beijing-funded projects came under fire too, from the East Coast Rail Link to Forest City, a giant residential investment scheme on a Dubai-style reclaimed island in Johor, close to Singapore.

Chinese investments had once been popular with the public. Now, opposition leaders accused Datuk Seri Najib of denting Malaysia’s non-aligned status with deeper military-to-military Chinese ties, portraying him as the plaything of a foreign power. “Lots of people don’t like Chinese investments,” Dr Mahathir told Bloomberg in an interview last month. “We are for Malaysians. We want to defend the rights of Malaysians. We don’t want to sell chunks of this country to foreign companies.”

China’s decision to pump billions into South-east Asia is mostly positive for a region with pressing infrastructure investment needs. Yet, rather than being lauded, President Xi Jinping’s strategy risks feeding anti-Chinese sentiment and undermining the geopolitical dividends the Belt and Road Initiative was partially designed to provide.

Malaysia’s polls are not the first in which China has provoked a backlash. In 2015, Sri Lanka’s government lost an election it was expected to win because of controversies over Chinese-funded “white elephant” infrastructure schemes. From Indonesia and Laos to Myanmar and Thailand, China’s mega projects have often proved politically controversial and a source of public resentment.

Since his victory, Dr Mahathir has quickly distanced himself from this legacy, promising reviews and possible cancellations of Chinese-backed projects.

How will the new government move forward? Malaysia is unlikely to move sharply away from China. With a sizeable domestic Chinese population, few Malaysian leaders want to be seen as “anti-Chinese”. Malaysia will still want Chinese investment too.

Dr Mahathir’s decision over the weekend to make Malaysia’s richest man, Hong Kong-based billionaire Robert Kuok, a government adviser also appears to be a conciliatory signal towards Beijing, given Mr Kuok’s close Chinese ties. Despite his rhetoric on the stump, Dr Mahathir understands the value of foreign funds and will be keen to keep Chinese investment flowing.

Still, a more balanced and independent-minded approach to China is now likely. Even modest rebalancing could have important implications, for instance in the ongoing contretemps in the South China Sea, in which Malaysia is a claimant state, and where Dr Mahathir has said it must uphold its claims firmly if need be, against China.

Elsewhere, Chinese companies may face renegotiation or even cancellation of some existing contracts, as well as greater competition for future deals. One test case will be the planned Kuala Lumpur-Singapore high-speed rail project. The recent election probably increases Japan’s odds of winning the project, not least because China’s bidders will no longer be able to rely on the goodwill developed with Mr Najib. Related Story

The more interesting question is whether other nations will follow this path. Every country in South-east Asia now faces the same dilemma: how to attract China’s largesse but avoid the popular discontent that often comes with it. Most regional leaders take the money up front and hope to manage the grumbling later. This has rarely worked out well. Now Mr Najib’s humiliation might prompt some to rethink.

This is especially true for those like Indonesian President Joko Widodo, who faces elections next year and must cope with the legacy of a controversial and long-delayed high-speed rail project between Jakarta and Bandung. Around the region, the lessons from Malaysia’s earthquake should be clear: Big infrastructure projects are controversial, especially if citizens see their governments heading into the pockets of foreign powers.

That same insight should resonate in Beijing. China’s decision to pump billions into South-east Asia is mostly positive for a region with pressing infrastructure investment needs. Yet, rather than being lauded, President Xi Jinping’s strategy risks feeding anti-Chinese sentiment and undermining the geopolitical dividends BRI was partially designed to provide.

This is mostly China’s own fault. The projects are often opaque, leading to problems of corruption and environmental degradation. Long-term debts can be heavy. An often-heard complaint is that Chinese companies take up an inordinately large share of the sub-contracts, leaving little for local companies and workers. Little wonder they aren’t popular.

China should rejig BRI to make it more open and inclusive. If not, Malaysia’s Chinese backlash may be the first of more to come.

James Crabtree is a senior fellow at the Centre on Asia and Globalisation at the Lee Kuan Yew School of Public Policy, National University of Singapore. Blake Berger is a research associate at the centre.