Countries Where Being Gay Is Illegal: Penalties and Travel Risks

At least 64 United Nations member states criminalize consensual same-sex sexual activity, and the countries where being gay is illegal impose penalties ranging from small fines to execution. Seven of those states prescribe the death penalty; roughly a dozen more allow life imprisonment. Enforcement varies widely, from dormant colonial-era statutes to active police entrapment operations, and the map keeps shifting: some jurisdictions have decriminalized in the past few years while others have added harsher laws.

Countries That Impose the Death Penalty

Seven countries authorize execution as a legal punishment for same-sex conduct, though not all of them carry sentences out.

Iran’s Islamic Penal Code is the most explicit. Article 110 states that the punishment for sodomy “is killing,” with the judge deciding how the sentence is carried out. Both adult participants of sound mind who acted voluntarily face execution.1International Labour Organization. Islamic Penal Law in Iran

Saudi Arabia operates without a formal written penal code. Judges apply their interpretation of Sharia, and punishment depends on circumstances: married men convicted of same-sex acts face execution, unmarried men face flogging. Conviction requires either a confession or the testimony of four adult male witnesses. Yemen’s 1994 Penal Code similarly prescribes death by stoning for married men, and flogging or prison for unmarried men.

Mauritania’s Article 308 states that any adult Muslim man who commits a same-sex sexual act faces death by public stoning, though the country has observed a de facto execution moratorium since 1987.2Immigration and Refugee Board of Canada. Mauritania: The Treatment of Sexual Minorities by Society and the Authorities In northern Nigeria, twelve states enforce Sharia penal codes alongside federal criminal law; these state codes prescribe execution for Muslims convicted of sodomy, while the federal system imposes prison.3International Center for Not-for-Profit Law. Same Sex Marriage (Prohibition) Act, 2013

Afghanistan, under Taliban governance since 2021, enforces Sharia law with death as the maximum punishment for same-sex conduct between either men or women. A 2024 Propagation of Virtue and Prevention of Vice Law added further criminalization and gave enforcers broad discretion to impose detention, fines, or other punishments they consider appropriate. Brunei’s 2019 Sharia Penal Code prescribes death by stoning, though the sultan extended a longstanding execution moratorium to cover these offenses that same year.

Uganda belongs on this list too. Its 2023 Anti-Homosexuality Act includes the death penalty for “aggravated homosexuality,” which covers same-sex acts involving HIV transmission, acts against minors, and serial offenders.4Parliament of the Republic of Uganda. The Anti-Homosexuality Act, 2023

Countries Where Same-Sex Acts Carry Prison Sentences

Imprisonment is the most common consequence across the remaining criminalizing states. Sentences run from a few months to life.

East and Southern Africa

Uganda’s 2023 law imposes life imprisonment for the base offense and up to twenty years for “promoting homosexuality,” including running support organizations or publishing material seen as encouraging same-sex relationships.4Parliament of the Republic of Uganda. The Anti-Homosexuality Act, 2023 Tanzania criminalizes “carnal knowledge against the order of nature” under Section 154 of its Penal Code, with penalties up to life. Zambia’s amended Penal Code sets a minimum of fifteen years and a maximum of life for the same offense.

Middle East

Qatar’s Penal Code punishes consensual same-sex acts between men with up to seven years; the penalty rises to fifteen years when the convicted person holds authority over the other party.5Al Meezan. Law No. 11 of 2004 Issuing the Penal Code Kuwait’s Article 193 carries a similar seven-year maximum. Non-citizens convicted in Gulf states routinely face deportation on top of prison time.

Iraq passed sweeping amendments to its Law on Combatting Prostitution in 2024, imposing ten to fifteen years for same-sex relations, seven years for “promoting homosexuality,” and one to three years for gender-affirming medical procedures or what the law calls “imitating women” in public. The promotion offense is left deliberately undefined.

Caribbean

Several Caribbean states retain colonial-era buggery statutes. Jamaica’s Offences Against the Person Act punishes buggery with up to ten years of imprisonment with hard labor.6Parliament of Jamaica. Jamaica Code – Offences Against the Person Act Barbados sets life imprisonment as the maximum under its Sexual Offences Act.7Barbados Law Courts. Cap. 154 Sexual Offences Guyana’s Article 354 prescribes life for buggery and two to ten years for other same-sex sexual activity. Saint Vincent and the Grenadines also criminalizes buggery with substantial prison terms.

Enforcement across the Caribbean is generally infrequent, but a criminal record for these offenses can permanently damage someone’s employment and housing prospects. Saint Lucia’s High Court struck down the country’s criminalization laws in July 2025.

North Africa

Algeria and Morocco both impose prison sentences of six months to three years. Morocco’s Article 489 adds a fine of 200 to 1,000 dirhams. Algeria’s penalties vary between Article 338 (homosexuality, up to two years) and Article 333 (same-sex public indecency, up to three years with a higher fine). Even short sentences carry lasting fallout: job loss, family estrangement, and ongoing police attention.

Morality and Public Decency Laws Used as Proxies

Some countries avoid naming same-sex conduct in their penal codes and use vaguely worded morality statutes instead. Prosecutors get flexibility, and defendants get less room to challenge the charge.

Egypt

Egypt’s primary tool is Law No. 10 of 1961, officially an anti-prostitution law. Article 9(c) punishes anyone who “habitually engages in debauchery” with three months to three years in prison.8Egyptian Initiative for Personal Rights. Law No. 10/1961 Courts have read “debauchery” to cover consensual same-sex conduct, and prosecutors have used that reading aggressively since at least 2001. Police create fake profiles on dating apps, arrange meetings, and arrest targets on arrival. Phones are then searched for photos, messages, and app data. Additional charges under cyber laws often carry higher penalties and a lower evidentiary bar.

Russia

Russia has built a layered system. The 2013 “gay propaganda” law originally banned sharing information about “non-traditional sexual relationships” with minors. A December 2022 expansion applied it to all ages, effectively banning any public LGBTQ+ expression. Individual violations carry fines up to 400,000 rubles (roughly $6,400); organizations face fines up to 5 million rubles (roughly $80,000). Foreign citizens can be detained for up to fifteen days and deported.

In November 2023, the Supreme Court designated the “international LGBT movement” as an extremist organization. Participating in or financing an extremist group carries up to twelve years in prison under Russian criminal law. Displaying symbols associated with such a group can lead to fifteen days’ detention on a first offense and up to four years for a repeat. Authorities can freeze bank accounts and bar suspected participants from public office. In practice, any visible association with LGBTQ+ identity now carries criminal risk in Russia.

Laws That Reach Beyond the Two People Involved

In several countries the law reaches witnesses, supporters, and anyone who fails to report same-sex conduct. This is what makes some of these legal regimes uniquely dangerous, because family, landlords, employers, and clinicians all become potential co-defendants.

Nigeria’s Same Sex Marriage (Prohibition) Act of 2013 imposes fourteen years for entering a same-sex marriage or civil union, and up to ten years on anyone who “administers, witnesses, abets or aids” such a ceremony. The same ten-year sentence applies to anyone who “registers, operates or participates in gay clubs, societies or organisations” or “directly or indirectly makes public show of same sex amorous relationship.”3International Center for Not-for-Profit Law. Same Sex Marriage (Prohibition) Act, 2013 Leasing property to an LGBTQ+ organization could suffice for prosecution.

Uganda’s 2023 law criminalizes “promotion” with up to twenty years.4Parliament of the Republic of Uganda. The Anti-Homosexuality Act, 2023 Iraq’s 2024 amendments impose seven years for the same offense. These provisions effectively criminalize advocacy, legal representation, and humanitarian support, and they push healthcare providers to refuse care rather than risk accusation.

Where National Law and Local Enforcement Diverge

Legal reality can vary sharply within a single country. Two regions illustrate how subnational authority produces pockets of extreme enforcement inside states that look different at the national level.

Aceh, Indonesia

Indonesia does not criminalize same-sex conduct at the federal level. The province of Aceh, which has special autonomy over Islamic criminal law, implemented the Qanun Jinayat in 2015. It criminalizes same-sex relations and prescribes public caning. In August 2025, two men in their twenties were publicly flogged 76 times each after a Sharia court found them guilty of consensual same-sex activity.9JURIST. Activists Condemn Public Flogging of Two Men Under Indonesia’s Islamic Criminal Law Sentences of up to 200 lashes have been authorized. The Aceh code applies to both Muslims and non-Muslims in the province.

Chechnya, Russia

While federal Russian law focuses on propaganda bans and extremism designations, Chechen authorities have carried out mass detentions of men perceived as gay. Starting in April 2017, reports emerged of more than 100 men held in secret detention facilities where they were tortured and, in some cases, killed. The Organization for Security and Cooperation in Europe described “systematic torture, abuse and murder” in a 2018 report. Chechen leadership has publicly denied that LGBTQ+ people exist in the region, a position that effectively guarantees impunity. Local police have been reported to confiscate victims’ documents and threaten them with criminal charges to prevent them from fleeing.

Digital Surveillance and Entrapment

Enforcement has changed in the smartphone era. Police in countries including Egypt, Lebanon, and Tunisia routinely seize phones during arrests and search them for dating app profiles, text messages, photos, and call logs. A single selfie or flirtatious text can be introduced as evidence of “practicing homosexuality” or committing “acts against nature.”

Refugees, migrant workers, and others with precarious legal status face the highest risk because they are less likely to challenge an arrest and more vulnerable to coercion. Expanded cyber laws in several jurisdictions have compounded this: digital morality offenses often carry higher penalties and require less evidence than the underlying debauchery or indecency charges. Having a dating app installed can be treated as evidence of intent to commit a crime.

Travel Risks and HIV Entry Restrictions

Foreign nationality provides no protection in countries where same-sex conduct is illegal. Visitors have been arrested, prosecuted, and deported under these statutes, and Gulf states routinely add deportation orders to prison sentences for non-citizens.

HIV-related travel restrictions add a second layer. As of mid-2025, fifty countries enforce some form of restriction tied to HIV status, ranging from mandatory testing during the visa process to entry bans and deportation upon discovery. Seventeen countries impose the most severe measures, including Iran, Kuwait, Malaysia, Russia, and the United Arab Emirates. In 2024, Kuwait alone deported more than 100 people after HIV testing.

Before travel, check the current legal status of same-sex conduct in every country on your itinerary, including layover destinations. Laws change in both directions, and enforcement often differs from what the statute says. A dormant law can become an active prosecution tool with no warning.

Asylum Protections for People Fleeing Criminalization

People fleeing criminalizing countries can seek refugee status under both international and U.S. law. Under 8 U.S.C. 1101, a refugee is someone unable or unwilling to return to their home country because of persecution or a well-founded fear of persecution on account of race, religion, nationality, membership in a particular social group, or political opinion.10Office of the Law Revision Counsel. 8 USC 1101 – Definitions LGBTQ+ individuals from countries with criminalization laws have been recognized as members of a “particular social group.” A successful claim requires showing that sexual orientation or gender identity was a central reason for the persecution experienced or feared.

UNHCR guidelines reinforce this framework internationally. A key principle is that no applicant can be denied refugee status on the grounds that they could avoid persecution by concealing their identity. An adjudicator cannot argue that you would be safe if you stayed closeted.11UNHCR. UNHCR’s Views on Asylum Claims Based on Sexual Orientation and Gender Identity The guidelines also prohibit medical “testing” of a claimant’s sexual orientation and require specialized training and respectful language from interviewers.

Practical barriers are steep. Applicants often must disclose deeply personal information to government officials in a second language, sometimes through interpreters from their own community. Countries that criminalize same-sex conduct can also impede access to asylum procedures at the source, since approaching authorities with an LGBTQ+ claim in a criminalizing jurisdiction means identifying yourself to the system that threatens you. Private attorneys for U.S. asylum cases charge $200 to $600 per hour, though nonprofit legal organizations provide free representation in many cases. Reaching one of those organizations before your filing deadline is often the difference between a successful claim and deportation.