NAMEWEE is a Malaysian rapper with a penchant for extravagant eyeware and a dangerous interest in politics. Police picked him up at the country’s main airport in August, when he flew home from a spell abroad. A score of touchy groups had complained that an early cut of his latest video—which featured performers dressed as religious leaders gadding about a church, a mosque and a Chinese temple—insulted the dignity of Islam, a charge punishable by two years in prison. Authorities talked about asking Interpol to help them question his collaborators, a three-piece band based in Taiwan.

In gentler times Namewee’s only offence might have been crimes against music. But Malaysian Islam is gradually growing sterner, and its promotion by the state more aggressive. These trends are getting a boost under the government of the prime minister, Najib Razak. Tormented by claims that a national investment firm has been looted, his party is keen to change the subject. So it is recasting itself as a defender of Islam, the religion of its ethnic-Malay supporters. All this is souring race relations and worrying neighbours, who fear the shift will nurture extremism.

A little over 60% of Malaysia’s 32m citizens are Muslims, mainly ethnic Malays. Most of the rest—including Malaysians of Chinese and Indian descent, as well as various indigenous tribes—are Buddhist, Christian, Hindu or not religious. A constitution propagated at the end of British rule in 1957 guarantees non-Malays the right to follow a religion of their choosing, while also proclaiming, “Islam is the religion of the Federation.”

That compromise has spurred endless debate over how far the government should patronise the faith of the majority. The United Malays National Organisation (UMNO), the outfit that has led Malaysia’s ruling coalitions since independence, found religion in the 1980s while fending off a challenge from a pious opposition party. Mahathir Mohamad, UMNO president and prime minister from 1981 to 2003, claimed that Malaysia was an “Islamic country”. His government created a department within the prime minister’s office to regulate and promote Islam.

Malaysian Islam has grown increasingly conservative in the years since, influenced by austere theologies from the Middle East. Its promotion is a particular preoccupation of Malay nationalists, who insist the country’s minorities have secured an unfair helping of its wealth. (Chinese and Indian Malaysians do better in school and tend to earn more.) Meanwhile the country’s Islamic bureaucracy has expanded at both the federal and state level. Religious officials occasionally raid hotels in search of unmarried Muslim couples and other deviants (Justice for Sisters, a campaign group, says that at least 63 transgender women were arrested between January and May); Shia Muslims are also persecuted. A ruling in August reiterated that Malaysian Muslims may not leave the faith without the consent of the Islamic authorities, who never give it.

In theory Malaysia’s non-Muslims are not subject to religious rules, but the atmosphere often affects them. Hostility towards church-building means that growing Christian congregations are meeting in warehouses and empty shops, says a clergyman. Functionaries in some public buildings have required Malaysians to cover their legs before gaining access to government services. Only last month bureaucrats said they preferred not to let Muslim families hire non-Muslim maids. Critics of religious authorities are often branded anti-Muslim; outspoken ones have sometimes been charged with sedition.

Mr Najib says the government will give secular courts, not Islamic ones, the sole right to rule in divorces when only one spouse is Muslim. That will simplify a handful of cases where people try to game the system. (For example, a divorcing husband converts to Islam on the assumption that the Islamic courts will give him custody of the kids.) Yet broadly Mr Najib is seen to be less independent-minded than his predecessors about religious policy, and more reliant on Islamic advisers.

Moreover, his party looks less inclined to rein in Islamist firebrands as threats to its six-decade rule mount. Mr Najib nearly lost a general election in 2013, when minority voters abandoned UMNO’s coalition partners. Since then it has emerged that billions of dollars went missing from 1MDB, a state-owned investment firm, during the prime minister’s first term. Mr Najib denies receiving any of the cash. He has kept his job even though an investigation by America’s Department of Justice, made public in July, appears to implicate him.

Perhaps seeking an alliance that could sustain UMNO even without support from minorities, Mr Najib is cosying up to the Islamist opposition. In May his party fast-tracked the reading of a bill proposed by the Pan-Malaysian Islamic Party (PAS), which is seeking to increase the punishments Islamic courts may inflict on Muslims convicted of religious offences. Currently these are limited to a fine, six strokes of the cane or three years in jail. Some in PAS think that Muslims who drink alcohol should receive as many as 80 lashes, and those who have sex outside marriage 100.

UMNO had long opposed such measures, which some see as a step towards hand-chopping and stoning. The party may simply be dwelling on the subject because it has helped to tear apart the uneasy opposition alliance, which until recently included both PAS and secular parties. But UMNO may eventually conclude that more floggings are a reasonable price to pay for support from PAS.

All this is bound to exacerbate an exodus of young Malaysians, including many moderate Muslims. The World Bank has found that the number of Malaysians living in rich countries roughly tripled between 1990 and 2010, and that more than half of these emigrants have university degrees. A gradual exodus of minorities delights Malay supremacists but will make the country poorer.

A more immediate worry is that a rise in racially charged rhetoric will encourage radicals. Nearly 70 Malaysians have had their passports cancelled after joining Islamic State (IS) in the Middle East. Police recently arrested three men said to be plotting attacks on nightspots and a Hindu temple. Last year 11% of Malaysians quizzed by Pew, a pollster, claimed to have a “favourable” view of IS, compared with only 4% in neighbouring Indonesia. That, surely, should be a more pressing concern than Namewee’s videos.