More than 60 countries criminalize consensual same-sex sexual activity, and the countries where being gay is illegal span Africa, the Middle East, Southeast Asia, and the Caribbean.1Travel.State.Gov. Gay and Lesbian Travelers Penalties range from fines and short jail terms to life imprisonment and execution. At least five countries actively carry out the death penalty for same-sex conduct; dozens more impose prison sentences; a growing number also criminalize public expression, advocacy, and identity itself.
Countries With the Death Penalty for Same-Sex Conduct
Iran, Saudi Arabia, Yemen, Somalia, and parts of northern Nigeria actively execute people for consensual same-sex conduct. Several other countries keep the death penalty on the books without recent documented enforcement: Afghanistan, Brunei, Mauritania, Pakistan, Qatar, the United Arab Emirates, and Uganda.
Iran’s Islamic Penal Code prescribes execution for sodomy. A married person convicted of same-sex intercourse faces death; an unmarried person may receive 100 lashes instead. Conviction requires a confession or multiple witnesses.2United Nations Office on Drugs and Crime. Islamic Penal Code of the Islamic Republic of Iran
Saudi Arabia has no single codified statute on homosexuality. Judges apply their interpretation of Sharia, which can produce the death penalty for a married person and 100 lashes for an unmarried one. In practice, judicial discretion is broad.3Immigration and Refugee Board of Canada. Treatment of Homosexuals in Saudi Arabia
Yemen’s 1994 Penal Code imposes death by stoning for a married person convicted of sodomy, and up to 100 lashes or a year in prison for an unmarried person. In early 2024, Houthi-controlled courts in northern Yemen sentenced multiple people to death on homosexuality charges.
Afghanistan’s situation hardened after the Taliban takeover in 2021. The existing penal code already allowed judges to apply Sharia carrying a death sentence, and the Taliban’s 2024 Propagation of Virtue and Prevention of Vice Law gave enforcers explicit authority to impose whatever penalty they consider appropriate. A Taliban judge publicly stated that gay men face “death by stoning, or he must stand behind a wall that will fall down on him.”
In northern Nigeria, several states operate Sharia-based penal codes alongside federal law and prescribe death by stoning for same-sex intercourse, with enforcement varying by jurisdiction. Brunei’s 2013 Syariah Penal Code Order includes sodomy as an offense punishable by stoning, though the government announced a moratorium on carrying out the death penalty after international pressure.4Attorney General’s Chambers of Brunei Darussalam. Syariah Penal Code Order 2013
Countries With Life Sentences or Long Prison Terms
Uganda’s Anti-Homosexuality Act of 2023 is among the harshest laws currently in force. Homosexuality carries a life sentence. The law also created “aggravated homosexuality,” covering offenses involving a minor, a person over 75, a disabled person, or a repeat offender, which carries the death penalty.5Parliament of the Republic of Uganda. The Anti-Homosexuality Act 2023
Tanzania’s penal code punishes “carnal knowledge against the order of nature” with a minimum of 30 years and a maximum of life imprisonment. Kenya criminalizes same-sex relations under Sections 162 and 165 of its Penal Code, with a maximum penalty of 14 years. A constitutional challenge has been working through the Kenyan courts for years, with the Court of Appeal repeatedly adjourning hearings as recently as February 2026.
Nigeria’s federal Same Sex Marriage (Prohibition) Act of 2014 punishes entering a same-sex marriage or civil union with up to 14 years in prison. Participating in LGBTQ+ organizations, registering a gay club, or publicly displaying a same-sex relationship can bring up to 10 years. This is a separate layer from the northern states’ Sharia codes.
Iraq moved sharply in this direction in 2024, when parliament amended its anti-prostitution law to criminalize same-sex relations with 10 to 15 years in prison. The law defines the offense as “sexual perversion” occurring more than three times, and also punishes “promoting homosexuality” with up to 7 years and fines exceeding $7,000.
Countries With Shorter Prison Sentences
Jamaica still enforces the Offences Against the Person Act of 1864, a colonial-era law that punishes “buggery” with up to 10 years of imprisonment with hard labor.6Ministry of Justice Jamaica. Offences Against the Person Act Morocco’s Penal Code prescribes six months to three years under Article 489.7Immigration and Refugee Board of Canada. Morocco – Situation of Sexual Minorities Tunisia’s Article 230 carries up to three years for sodomy. Egypt has no statute explicitly mentioning homosexuality, but authorities routinely prosecute gay men under a debauchery law originally written to combat prostitution, with sentences of up to three years.
Even shorter sentences carry consequences past the prison term. A conviction creates a permanent criminal record that can block employment, housing, and international travel. In countries where same-sex conduct is a morality offense, an arrest without conviction can be enough to upend someone’s life.
Laws That Criminalize Identity and Expression
A separate tier of law targets speech, association, and visibility rather than sexual acts. These “propaganda” and “promotion” laws can reach people who have never been accused of any physical conduct.
Russia set the template. A 2013 law banned sharing information about “non-traditional sexual relations” with minors. In 2022, parliament expanded the ban to all age groups, effectively outlawing public demonstrations, rainbow symbols, and LGBTQ+ organizations. Individuals face fines up to 400,000 rubles, organizations up to 5 million rubles or dissolution, and foreign nationals can be detained up to 15 days and deported.
Hungary’s Act LXXIX, adopted in 2021, restricts depictions of LGBTQ+ content in schools and media aimed at anyone under 18. The European Commission launched infringement proceedings arguing the law violates EU fundamental rights.8European Parliamentary Research Service. Hungarys Pride Ban
Uganda’s 2023 law also criminalizes the “promotion of homosexuality,” which can reach advocacy and the provision of health services. The original version required citizens to report suspected homosexuality to authorities; Uganda’s Constitutional Court struck down that mandatory reporting provision in April 2024. Ghana’s parliament passed the Human Sexual Rights and Family Values Bill in 2024, which extends criminal penalties to human rights defenders, teachers, medical professionals, and landlords perceived as allies of LGBTQ+ people.9Office of the UN High Commissioner for Human Rights. Ghana – Turk Alarmed as Parliament Passes Deeply Harmful Anti-Gay Bill
How These Laws Are Actually Enforced
The distance between what the statute book says and what police do varies widely. Some countries rarely prosecute. Others enforce aggressively, using methods international bodies have condemned as torture.
Forced anal examinations are one of the most disturbing enforcement tools. Medical personnel insert fingers or objects into a suspect’s body without consent, claiming to look for physical evidence of receptive intercourse. The UN Special Rapporteur on Torture has described these examinations as “medically worthless” and a form of cruel, inhuman, and degrading treatment. Since 2011, physicians in at least 11 countries have participated in them.10World Medical Association. WMA Resolution on Prohibition of Forced Anal Examinations
Digital surveillance and entrapment are increasingly common. In Egypt, police create fake profiles on dating apps to lure targets into meetings where they are arrested. Street checkpoints in some countries include phone inspections, with officers searching for dating apps or private messages as evidence. The U.S. State Department specifically warns American travelers that “police in some destinations surveil websites and apps” and “may create false profiles to entrap U.S. citizens.”1Travel.State.Gov. Gay and Lesbian Travelers
Where the Law Is Moving
The direction over the past decade has mostly been toward decriminalization, with notable exceptions pushing the other way.
Decriminalization Since 2018
India’s Supreme Court struck down Section 377 as applied to consensual same-sex conduct in September 2018, removing criminal penalties for roughly 1.4 billion people in a single ruling. The Caribbean has seen a cascade of court decisions: Antigua and Barbuda’s High Court struck down its colonial-era law in July 2022; the Eastern Caribbean Supreme Court did the same for Saint Kitts and Nevis in August 2022; Barbados followed in December 2022; and Dominica’s High Court ruled in April 2024.
Bhutan amended its penal code in 2021. Singapore repealed Section 377A in January 2023, while simultaneously amending its constitution to prevent courts from requiring same-sex marriage. The Cook Islands voted to decriminalize in April 2023. Mauritius’s Supreme Court struck down its colonial-era law in October 2023, noting that criminalization “was never an expression of indigenous Mauritian values, but an imposition of the British colonial project.”11Office of the UN High Commissioner for Human Rights. Supreme Court Ruling Tells LGBTQ People in Mauritius That Their Dignity Is Valued
New or Tougher Restrictions
Uganda’s 2023 Anti-Homosexuality Act dramatically escalated penalties from the country’s existing colonial-era provisions, adding life sentences and the death penalty for aggravated offenses.5Parliament of the Republic of Uganda. The Anti-Homosexuality Act 2023 Iraq introduced criminal penalties for same-sex conduct in 2024 where none had previously existed in the statute books. Russia’s 2022 expansion of its propaganda law effectively silenced the country’s remaining LGBTQ+ organizations. Ghana’s 2024 bill would, if fully enacted, criminalize not just same-sex conduct but anyone perceived as an ally.
Travel Risks for Americans Abroad
If you are an American traveling to a country that criminalizes same-sex conduct, the U.S. government cannot shield you from local law. The State Department states plainly: “You are subject to local laws of the destination where you travel.”1Travel.State.Gov. Gay and Lesbian Travelers
Practical risks go beyond the criminal code. Watch for entrapment operations using fake dating profiles, be cautious with new acquaintances who may attempt extortion, and think carefully before disclosing your sexual orientation to medical providers in countries where same-sex conduct is illegal. If you carry a U.S. passport with an X sex marker, check destination regulations before you travel because many countries’ immigration systems cannot process that marker.
If you are arrested abroad, the nearest U.S. embassy can provide a list of local attorneys, notify your family, visit you in detention, and request that local officials provide medical care. The embassy cannot get you out of jail, pay your legal fees, represent you in court, or intervene in the proceedings.12Travel.State.Gov. Arrest or Detention Abroad
Asylum in the United States
People fleeing countries that criminalize same-sex conduct can apply for asylum in the United States. Federal law allows asylum for anyone who can show a well-founded fear of persecution based on membership in a “particular social group,” which U.S. courts have recognized as including sexual orientation and gender identity.13Office of the Law Revision Counsel. 8 USC 1158 – Asylum
The deadline is strict. You generally must file Form I-589 within one year of arriving in the United States. Missing that deadline can make you ineligible, though limited exceptions exist for changed circumstances or extraordinary situations.14U.S. Citizenship and Immigration Services. I-589 Application for Asylum and for Withholding of Removal You do not have to prove you were personally prosecuted under a sodomy statute. A credible showing that you would face persecution if returned, from government authorities or from private actors the government is unwilling to control, can be enough. The evidentiary bar is real, however, and applicants without legal representation have significantly worse outcomes. If you are in this situation, connecting with an immigration attorney before the one-year deadline is the single most important step you can take.