In his campaign against Malaysian Prime Minister Najib Razak, ex-premier Mahathir Mohamad has accused his successor of selling the country out by granting sweetheart deals to investors from China and encouraging mass immigration.

To the cynical observer, such claims may appear familiar as the kind of racially charged rhetoric that has characterised politics in this multi-ethnic and multi-religious country ever since its independence from Britain more than 50 years ago – particularly given Mahathir’s choice of bogeyman: Chinese influence. Fears of the clout wielded by Malaysia’s economically dominant Chinese community run deep in this country – so deep that policies ensuring special rights for ethnic Malays are enshrined in its constitution.

But are Mahathir’s claims, as his detractors charge, cynical moves to tap latent anti-Chinese sentiment among rural ethnic Malays and win their support from Najib’s ruling Barisan Nasional (National Front)?

Or are those detractors themselves using the spectre of racism to divert attention from the troubling links between China and Najib and the impact of Chinese investment on Malaysian businesses?

Mahathir, Najib’s former mentor, has been critical of Malaysia’s increasing reliance on Chinese funding since he launched a new party last year to take on his successor.

When Najib led a huge trade delegation to China in November last year, securing infrastructure projects worth 143 billion ringgit (HK$250 billion), Mahathir attacked the deals as jeopardising sovereignty. More recently, Mahathir provoked a storm by claiming the Chinese-backed 170-billion-ringgit Forest City development, 14 sq km housing project in South Johor, would create a “foreign enclave”.

The real reason Malaysia’s Mahathir is taking on the Sultan of Johor

Critics say such attacks undermine a core policy of Mahathir’s allies in the opposition Pakatan Harapan, or ‘Hope Coalition’, which seeks to oust the Barisan Nasional in general elections widely expected to be called this year. The coalition’s long-held policy is to bring an end to the kind of racial and religious politics that some are now accusing Mahathir of perpetuating.

They also warn the 91-year-old’s efforts to win over rural Malays could jeopardise the support of ethnic Chinese Malaysians, who in general have been solid supporters of the opposition coalition.

Whatever Mahathir’s true motives, controversy over his stance on Chinese investment is the latest snag in the coalition’s efforts to unseat Najib – efforts that have faltered despite the unpopularity of the prime minister, who is fighting corruption allegations regarding the state fund 1Malaysia Development Berhad (1MDB).

Mahathir versus the sultan: How Chinese investment could sway Malaysian election

Najib was drawn into the crisis surrounding the fund when it was revealed that US$681 million in transfers were made to his personal bank accounts in 2013. He says they were “personal donations” from the Saudi royal family and has denied all wrong-doing.

Against this backdrop, China has been a white knight for Najib, buying up assets in the troubled 1MDB by outbidding everyone else, fuelling opposition concerns that the Chinese are buying influence.

Just one month after Najib led the trade delegation to China, a Financial Times report claimed China would help settle a legal dispute between 1MBD and an Abu Dhabi state owned fund.

Mahathir, for his part, has denied being anti-Chinese.

“I categorically welcome FDI [foreign direct investment) from China as I welcome FDI from any country. What I object to is the kind of FDI from China,” Mahathir wrote in a recent blog. “It is not about investing in manufacturing industries in Malaysia. It is about acquiring land in Malaysia, building settlements, towns, and cities which are to be sold to mainland Chinese who will come and live here. They will not number in the hundreds or thousands but in the millions.

“The Chinese are welcome to invest in industries in Malaysia. But just as we would not welcome mass immigration of Indians or Pakistanis or Europeans or Africans into Malaysia we have to adopt the same stance on Chinese immigration into Malaysia.”

In Lunar New Year blog post, Malaysia’s Mahathir insists he is not anti-Chinese

Political analyst Ibrahim Suffian said the fear of “foreigners invading the country” had been embedded in the Malay psyche since Malaysia gained independence from Britain in 1957.

Ironically, this fear had historically been exploited by Najib’s party the United Malay National Organisation, or Umno, to cement support from Malays, said Ibrahim. “Now those fears are being used against Umno and Najib as they coax investment from China,” said Ibrahim of the Merdeka Centre.

Mahathir was himself a member of Umno before he quit last year in light of its support for Najib.

Businessman-turned-politician Michael Tay said most ethnic Chinese Malaysian business people considered Mahathir’s recent statements regarding Chinese investment racist.

“Many see this type of racial politics as belonging to a long ago era,” said Tay, who is also a Barisan Nasional leader based in South Johor, where the Forest City project criticised by Mahathir is based.

“They say Mahathir does not seem to fit this globalised age where money travels across borders and race is irrelevant,” said Tay.

Such criticisms weight heavily on Mahathir’s coalition allies just as they try to form a pact that would appeal to a broad section of Malaysian society.

Is Malaysia’s former PM Mahathir Mohamad next to be arrested over anti-government protests?

In the most recent general election, when the opposition coalition won 52 per cent of the popular vote, it was a champion of inclusive, issue-based politics and promised to end racial discrimination. But it did not win enough votes from rural Malays to get enough seats to form the government.

The coalition saw Mahathir and his new party, the Malaysian Indigenous People’s Party or Bersatu, as the crucial missing link that would enable them to reach those crucial rural Malay votes.

“[Opposition parties] are desperate to partner with anyone even if this disregards their professed ideology,” said Tan Keng Liang, another Barisan Nasional leader, who claimed a recent regional election and two by-elections had shown people were losing faith in the opposition. “Thus, they are getting desperate as the 14th general election nears.”

Ibrahim, the analyst, said Mahathir’s rhetoric was not racist, but instead spoke to a broader sense of nationalism among Malaysians.

It was this nationalism, said Ibrahim, that made wide swaths of Malaysian society protest against the government’s plan in 2015 to ship in more than three million foreign workers to fill a supposed labour shortage. “However, because the fear of foreigners is a delicate topic due to Malaysia’s history and its multi-racial society, it needs a nuanced approach in order to not seem racist,” said Ibrahim.

What a handshake between Mahathir and Anwar really means for Malaysia

Liew Chin Tong, an opposition leader based in Johor, said criticising Chinese investments was not the same as attacking ethnically Chinese Malaysians. “The view that all Chinese Malaysians are automatically pro-China is also simplistic. Small and medium Chinese-owned businesses are worried about big capital from China because they cannot compete against them.”

WATCH: Thousands gather to demand Malaysian Prime Minister’s resignation

China-owned construction firms shipped in their own building materials, thus cutting out smaller local suppliers that were usually owned by Chinese Malaysians, Liew said.

“I don’t know if Chinese Malaysians think Mahathir is being racist,” added Liew. “But I can tell you that Chinese Malaysians are against China bailing out 1MDB.”