Brunei is introducing strict new Islamic laws that make sex between men an offense 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.
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.
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.
What is punishable under the changes to the penal code?
Lesbian sex however, carries a different penalty of 40 strokes of the cane and/or a maximum of 10 years in jail.
Public flogging would also apply for abortion. And amputation is the punishment for theft.
Other changes include making it a criminal offense to “persuade, tell or encourage” Muslim children under the age of 18 “to accept the teachings of religions other than Islam”.
The law mostly applies to Muslims, though some aspects will apply to non-Muslims.
Brunei, on the island of Borneo, is ruled by Sultan Hassanal and has grown rich on oil and gas exports.
The 72-year-old sultan 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.
This week Hollywood actor George Clooney and other celebrities 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”.
Brunei’s ruling royals possess a huge private fortune and its largely ethnic-Malay population enjoy generous state handouts and pay no taxes.
Muslims make up about two-thirds of the country’s population of 420,000.
Homosexuality was already illegal in Brunei and punishable by up to 10 years in prison.
Brunei has retained the death penalty but has not carried out an execution since 1957.