A ROUND of applause, ladies and gentlemen. Any typical leader of a typical democracy, when found with nearly $700m of ill-explained money from an unnamed foreign donor in his accounts, would experience a swift and fatal fall. Yet, nearly two years after news first broke that Najib Razak’s bank balance had been thus plumped up, his high-wire act continues.

You could even argue that the Malaysian prime minister, who denies any wrongdoing, is at the top of his game. Mr Najib appears to command the unstinting loyalty of the party, the United Malays National Organisation (UMNO), which leads the coalition that has ruled the country since independence in 1957. He has undermined a fractious opposition, not least by peeling an Islamist party away from it. And as investigations proceed in several other countries into the alleged bilking of colossal sums from 1MDB, an indebted state investment-fund whose advisory board Mr Najib once chaired, the prime minister himself remains untouched. Staying in power helps stave off any risk he might face of international prosecution. A general election is due by late August 2018, but perhaps Mr Najib will call a snap poll in the next few months to give himself several more years’ rule.

The question is how, despite the mysteries surrounding 1MDB and his personal accounts, the prime minister appears to be consolidating his power. Patronage is a big part of it. Though his wife has a lusty appetite for Hermès Birkin bags, and the wedding of his daughter to a nephew of the Kazakhstani president was an occasion of such bling that the Malaysian media were discouraged from publishing photographs, Mr Najib may be essentially right when he says the cash in his accounts was not for personal gain. An UMNO leader needs money to buy loyalty from powerful politicians. It is also handy for spreading largesse among ordinary Malays—including helping devout Muslims make the haj.

Threats are as important as money. Anwar Ibrahim, the charismatic leader of the informal opposition coalition which won the popular vote in an election in 2013 (though not, thanks to gerrymandering, a majority of seats), has been in prison since 2015 on trumped-up charges of sodomy. In November the leader of an anti-corruption rally in Kuala Lumpur was arrested and held under tough new security laws. Newspapers and bloggers have been hounded. The number of activists and politicians charged with sedition has shot up. As for 1MDB, the only conviction in Malaysia related to it has been of a whistle-blowing legislator who highlighted alleged wrongdoing by the fund’s managers.

Now perhaps Mr Najib feels that the chief risks from 1MDB are behind him. Bear in mind that among the most assiduous investigations to date have been those by America’s Department of Justice, which claims $3.5bn is missing from the fund. Yet the next American president, Donald Trump, speaks admiringly of Mr Najib, a golfing buddy. It might be hard for the department to pursue a full-throttle investigation if Mr Trump expressed displeasure.

At any rate, the prime minister is at work covering his domestic bases, including wooing the Islamist party, the Pan-Malaysian Islamic Party (PAS). Some analysts mock the PAS leader, Abdul Hadi Awang, as having ayatollah-like aspirations: the party has long urged for sharia punishments to apply much more widely to the Malay Muslims who make up nearly two-thirds of the population. Such a proposal is not only morally but also constitutionally iffy. Undaunted, Mr Najib took the extraordinary step last year of backing Mr Hadi’s private member’s bill, which aims to increase the power of Islamic courts. With little discussion in cabinet or with the other 12 coalition members, the government submitted it to Parliament.

Mr Najib’s strategy is clear. Although his image has not hitherto been one of ostentatious piety, he is rebranding himself as a Muslim devout. And the message to Malays is also clear: either you are with him, or, as Jayum Anak Jawan of Ohio University puts it in New Mandala, a website on South-East Asia, “your Malay-ness or Muslim-ness are brought into question.”

If that seems a masterstroke, looks may deceive. Mr Najib’s people insist that the issue is no business of the (non-Muslim) ethnic Chinese, who make up a quarter of the population, or with ethnic Indians, who make up a tenth. Yet these largely urban and prosperous groups worry that Mr Najib is playing a potentially explosive game of racial politics, targeted at them. That could galvanise the opposition.

Friendless in high places

As it is, Mr Najib is counting on the squabbling opposition not to get its act together—in particular, on its failing to acknowledge the futility of Mr Anwar leading the opposition from jail. Yet there is ample scope for surprises. A growing number of opposition sympathisers say that a heavyweight with political experience is needed to take on UMNO. The obvious candidate is Muhyiddin Yassin, a former UMNO deputy prime minister who fell out with Mr Najib over 1MDB. Last year he and Mahathir Mohamad, who ran the country for 22 years, founded an ethnic-Malay party opposed to Mr Najib. The opposition would need to swallow a lot of pride and some principles to ask Mr Muhyiddin to be its leader. But he shares some of its reformist agenda, and it would transform the opposition’s chances of victory.

Lastly, Mr Najib is running not only against the opposition, but against the economy. Since April the currency has fallen by nearly a quarter, reflecting the weak price of oil, a crucial export, and concern about cronyism under Mr Najib (Malaysia ranks second, after Russia, in The Economist’s crony-capitalism index). China’s help in bailing out 1MDB may have bought Mr Najib time, but budgets are strapped as economic growth starts to slow. If he can’t keep the money flowing, his seemingly loyal allies would abandon him in a jiffy. So if anything keeps the prime minister awake at night, it may well be a future without friends.