Brunei is introducing strict new Islamic laws that make anal sex and adultery offences punishable by stoning to death.
The new measures, that come into force on Wednesday, also cover a range of other crimes including punishment for theft by amputation.
The move has sparked international condemnation.
Brunei's gay community has expressed shock and fear at the "medieval punishments".
"You wake up and realise that your neighbours, your family or even that nice old lady that sells prawn fritters by the side of the road doesn't think you're human, or is okay with stoning," one Bruneian gay man, who did not want to be identified, told the BBC.
The sultan of the small south-east Asian nation on Wednesday called for "stronger" Islamic teachings.
"I want to see Islamic teachings in this country grow stronger," Sultan Hassanal Bolkiah said at a public address, according to AFP news agency, without mentioning the new laws.
Homosexuality was already illegal in Brunei and punishable by up to 10 years in prison.
Muslims make up about two-thirds of the country's population of 420,000. Brunei has retained the death penalty but has not carried out an execution since 1957.
What is punishable under the changes to the penal code?
The law mostly applies to Muslims, including children who have reached puberty, though some aspects will apply to non-Muslims.
- Offences such as rape, adultery, sodomy, robbery and insult or defamation of the Prophet Muhammad will carry the maximum penalty of death.
- Lesbian sex carries a different penalty of 40 strokes of the cane and/or a maximum of 10 years in jail
- The punishment for theft is amputation
- Those who "persuade, tell or encourage" Muslim children under the age of 18 "to accept the teachings of religions other than Islam" are liable to a fine or jail
Individuals who have not reached puberty but are convicted of certain offences may be instead subjected to whipping.
What has global reaction been?
Sultan Hassanal heads the Brunei Investment Agency, which owns some of the world's top hotels including the Dorchester in London and the Beverly Hills Hotel in Los Angeles.
Brunei's ruling royals possess a huge private fortune and its largely ethnic-Malay residents enjoy generous state handouts and pay no taxes.
But Hollywood actor George Clooney and other celebrities have now called for a boycott of the luxury hotels. TV host Ellen DeGeneres also called for people to "rise up", saying "we need to do something now".
Is this the first time Islamic law is being introduced in Brunei?
The country first introduced Sharia law in 2014 despite widespread condemnation, giving it a dual legal system with both Sharia and Common Law. The sultan had said then that the new penal code would come into full force over several years.
The first phase, which covered crimes punishable by prison sentences and fines, was implemented in 2014. Brunei had then delayed introducing the final two phases, which cover crimes punishable by amputation and stoning.
In the days since, there has been international outrage and calls for the country to reverse course.
"These abusive provisions received widespread condemnation when plans were first discussed five years ago," said Rachel Chhoa-Howard, a Brunei researcher at Amnesty International.
"Brunei's penal code is a deeply flawed piece of legislation containing a range of provisions that violate human rights."
The United Nations echoed the statement, calling the legislation "cruel, inhuman and degrading", saying it marked a "serious setback" for human rights protection.
There are several theories, but Matthew Woolfe, founder of human rights group The Brunei Project, said it could be linked to Brunei's weakening economy.
"One theory is that it is a way for the government to strengthen its hold on power in the face of a declining economy that could potentially lead to some unrest in future," Mr Woolfe told the BBC.
"Connected to this is [Brunei's] interest in attracting more investment from the Muslim world, along with more Islamic tourists… this could be seen as one way of appealing to this market."
Mr Woolfe also added that the government might have hoped to get away with the latest roll-out without anyone realising.
"I think that the government did want to ensure that the international uproar that followed implementation of the first phase in 2014 had well and truly died down before further [implementation], in the hope it would just quietly [do so] without anyone realising," he said.
"It wasn't until increasing international attention that it finally came out and confirmed [this]."
The penal code changes were posted on the attorney general's website in December but only came to public attention in late March. There was no public announcement.
One 40-year-old gay Bruneian currently seeking asylum in Canada, said the impact of the new penal code was already being felt in Brunei.
The ex-government employee, who left Brunei last year after being charged with sedition for a Facebook post that was critical of the government, said people were "afraid".
"The gay community in Brunei has never been open but when Grindr (a gay dating app) came that helped people meet in secret. But now, what I've heard is that hardly anyone is using Grindr anymore," Shahiran S Shahrani Md told the BBC.
"They're afraid that they might talk to a police officer pretending to be gay. It hasn't happened yet but because of the new laws, people are afraid," he said.
Another male Bruneian, who is not gay but has renounced Islam, said he felt "fearful and numb" in the face of the laws being implemented.
"We ordinary citizens are powerless to stop Sharia law from being implemented," said the 23-year-old who did not want to be identified.
"Under Sharia, I would face the death penalty for apostasy."
One gay man was hopeful that the laws may not actually be enforced widely.
"Honestly, I'm not too scared as the government here often bluffs with the harsh punishments. But it can and will still happen even with it being rare."