Muslims from around the world have long chosen Malaysia as a holiday destination, being widely viewed as a moderate Muslim country, where people of diverse ethnicity and religion live in harmony. Muslims account for approximately 60 percent of the population (most of them being ethnic Malay), with Chinese and Indian minorities accounting for most of the rest, practicing Buddhism, Christianity and Hinduism as they please. That is part of what makes Malaysia unique. Its tranquility is now under threat, however, a combination of simmering ethnic tension and government action that is taking the country down a dangerous path.

For decades, Malaysia's main opposition party - the Pan-Malaysian Islamic Party (PAS) - has promoted the adoption of Islamic law, and for decades the government has objected to such law, until now. Prime Minister Najib Razak has for many months been embroiled in a corruption scandal, in which he has admitted accepting nearly $700 million as a "donation" to him. Moreover, his government is in trouble, as urban voters are increasingly rejecting the ruling United Malay National Organization (UMNO) and it policies. Many Malaysians have had enough of Mr. Najib, UMNO, and the current government.

Mr. Najib and UMNO have therefore decided to court rural Malays, who tend to be more conservative and who support PAS in greater numbers than their urban counterparts. In May of this year, UMNO fast-tracked the reading of a bill drafted by PAS which sought to increase the punishment courts may impose on those Muslims convicted of religious offenses through existing Islamic courts. Opening that Pandora's Box has naturally created an uproar among moderate Muslims in the country.

Islamic law is already enforced in some capacity in the more conservative parts of the country, where, for example, religious authorities already check patrons' religion in hotels and bars. The authorities may already jail those who do not practice official interpretations of the law. Some PAS members want Muslims convicted of drinking alcohol to receive up to 80 lashes of the rattan cane, and for adulterers to receive up to 100 lashes of the cane, in ominous echoes of the punishment already dispensed in countries such as Iran and Saudi Arabia. Is the next step amputations for stealing and hangings for being gay? Moderate Muslims know that such a pivot toward the imposition of Islamic law usually only leads in one direction: more of the same.

UMNO had previously maintained that it opposed such measures, but it, and Mr. Najib, appear already to have concluded that floggings are a small price to pay to elicit the political support of PAS. The very idea that Mr. Najib and UMNO would embrace Islamic law for political gain is despicable, but also extremely short-sighted, given that doing so would likely prove to be difficult to reverse in the future, as well as having unintended consequences.

The imposition of Islamic law could embolden the country's most reactionary Muslims, who already favor the establishment of an Islamic state in Malaysia. More than 10 percent of Malaysians said just that in a recent survey. In July, Malaysian police arrested 14 suspected members of the Islamic State (IS), who were planning attacks on nightclubs and a Hindu temple. Recent estimates suggest that Malaysia is home to up to 150 members of the IS.

Promoting Islamic law also undermines the social compact the government has had with the Malaysian people since the 1970s, though that has been flawed. Following the severe race riots between Malays and Chinese in 1969, the government put in place its New Economic Policy, designed to ease conflict between different ethnicities and achieve national unity through what was supposed to be equality in economic opportunity.

However, concurrent with the NEP, the government implemented its "Bumiputra" system of preferential treatment for citizens of Malay descent (which for example resulted in the civil service being 85% populated by Malays and quota systems being put in place to favor Malay students in universities). Bumiputra was supposed to be temporary, but ended up becoming a pillar of modern Malaysian politics. It has since served as a source of resentment for citizens not of Malay descent. Racial tension has been simmering beneath the surface ever since. Anti-Chinese sentiment never disappeared and has recently flared up, as Malay nationalism rises in conjunction with Mr. Najib's and UMNO's actions.

A Muslim country that once defined moderation and modernity is now in danger of traveling down a judicial slippery slope leading to the Dark Ages. Should that occur, Malaysia would undoubtedly prove to be a breeding ground for the IS and other Islamic extremist groups, with implications for countries throughout the region, most notably neighboring Thailand and Singapore. The Malaysian government's fierce opposition to Islamic extremism over the past 15 years, and its successes in opposing it, stand to be overridden by what is becoming its own self-destructive behavior. Should Mr. Najib and UMNO continue down that path, racial divisiveness is sure to become further inflamed. With the Malaysian stock market near its low since Mr. Najib's re-election, and with the Malaysian ringgit brushing up against its all-time low with the U.S. dollar, the markets have little faith in the country's near term future - and with good reason.

*Daniel Wagner is Managing Director of Risk Cooperative and co-author of the new book "Global Risk Agility and Decision Making".