A heavily criticized penal code is set to take effect in Brunei next week, prescribing execution for Muslims found guilty of adultery, rape or sex with someone of the same gender.

First announced in 2013 but delayed in its implementation due to widespread international opposition, the law is part of a penal code being implemented in stages since 2014 that's directly inspired by lawmakers' reading of Islamic religious law, or sharia. Sharia law applies only to the country's Muslim population.

Homosexuality was already illegal in the small sultanate and punishable by up to 10 years in prison, but the new changes would permit execution by whipping or stoning for Muslims found guilty of sodomy, as well as rape or adultery.

The law will take effect on April 3 in the country of 420,000, a former British enclave that sits between two Malaysian states on the island of Borneo.

Roughly two-thirds of the oil-rich nation's population are Muslim, but the country is also home to significant Buddhist and Christian populations who will not be subject to the sharia restrictions, the UK Independent noted.

However, within Brunei there's been no vocal opposition, according to AP, where public criticism of Sultan Hassanal Bolkiah's rule is rare. Bolkiah has ruled since 1967 and presented the introduction of sharia, a first for a southeast Asian nation, as a major accomplishment of his rule and for the country's history.

Brunei is far from the only Commonwealth member or former British colony to have homophobic laws: Sputnik reported that 42 such states have retained or introduced aspects of colonial-era anti-sodomy laws, although in recent years several countries, such as India, Pakistan, South Africa and Namibia, have moved to decriminalize same-gender sexual relations and, in some cases, provide legal protections for LGBTQ and third gender people.

Last August, two Malaysian women were fined and publicly caned in the country's northern Terengganu province on suspicion of being lesbians. Malaysia has a dual-track legal system, Sputnik reported, in which Islamic courts handle religious and family matters, and sharia has been implemented in several states, including Terengganu.

In Indonesia, the world's most populous Muslim country, only Aceh province has implemented sharia, and it also punishes same-gender relations. Indonesia's parliament has seen multiple attempts to pass laws stigmatizing LGBTQ people, but none have succeeded so far, and the country's supreme court has repeatedly struck down attempts to expand existing laws on sex crimes to criminalize consensual homosexual behavior.