Capital punishment as a criminal punishment for homosexuality has been implemented by a number of countries in their history. It is a legal punishment in several countries and regions, all of which have Islamic-based criminal laws, except for Uganda.

Gay people also face extrajudicial killings by state and non-state actors in some regions of the world. Countries where this is known to occur include: Egypt, Iraq, Kenya, Nigeria, Senegal, Turkmenistan, Uganda, Russia, and as a general rule of thumb the vast majority of places where queer people's human rights/civil liberties are restricted by law.

Imposition of the death penalty for homosexuality may be classified as judicial murder of gay people.

In current state laws

The International Lesbian, Gay, Bisexual, Trans and Intersex Association (ILGA) reported in 2020 that in at least six UN member states—Brunei, Iran, Mauritania, Nigeria (some states in northern Nigeria), Saudi Arabia, and Yemen—homosexual activity is punishable by death. These six were joined in 2023 by Uganda, which became the only Christian-majority country (82% Christian in 2024) with capital punishment for some consensual same-sex acts. Excepting Uganda, all countries currently having capital punishment as a potential penalty for homosexual activity base those laws on interpretations of Islamic teachings called sharia laws. One source states that in 2007 alone, five countries had carried out executions for homosexuality. In 2020, the ILGA stated that Iran and Saudi Arabia were the only countries in which government-sanctioned executions for consensual same-sex sexual activity had taken place since 2000.

Complete legal certainty For the countries listed below, no dispute or uncertainty regarding the legal status of capital punishment as a possible penalty for same-sex sexual conduct exists. While clearly allowable, the application or enforcement of the legally-sanctioned death penalty varies across the jurisdictions, with some not having imposed or enacted the penalty for many years or decades, and some never having done so, while others have carried out executions recently and some do so regularly.

As of May 2023, the following jurisdictions allow the death penalty to be imposed for homosexual conduct: Brunei. The Penal Code Order () prescribes death by stoning for sex acts between men (in abeyance under a moratorium, which may be lifted without warning at any time), De facto penalty: Seven years in prison and 30 lashes for married men. Iran. Male-male anal intercourse is declared a capital offense in Iran's Islamic Penal Code, enacted in 1991. Articles 233 through 241 criminalise both female and male same-sex activity; for a first offence, the death penalty only applies to some cases of male-male penile-anal intercourse, with female-female activity and other cases of male-male activity being punished by flogging instead of execution. Under the combination of articles 136 and 238, a woman convicted for the fourth time of the crime of musaheqeh (tribadism) is to be executed; there is no death penalty for non-genital-genital female-female sexual conduct. Though the grounds for execution in Iran are difficult to track, there is evidence that several gay men were executed in 2005–2006 and 2016 mostly on alleged charges of rape. Mauritania. According to a 1983 law, Muslim men can be stoned for engaging in homosexual sex, though no executions have occurred so far. The country has observed a moratorium on the execution of the death penalty since 1987. De facto penalty: Two years in prison and a fine for both men and women. Nigeria. Several northern states have adopted sharia-based criminal laws, though no executions are known. Saudi Arabia. The kingdom does not have codified criminal laws. According to the country's interpretation of sharia, a married man who commits sodomy, or a non-Muslim who engages in sodomy with a Muslim, can be stoned to death. There are unconfirmed reports that two cross-dressing Pakistani nationals were killed by Saudi authorities in 2017, which Saudi officials have denied. Verified executions occurred in 2019. Homosexuality in Saudi Arabia is proven by four eyewitnesses who have seen the penetration, or a self confession; if these conditions are not met they can not be stoned but can be given discretionary punishments like lashing and imprisonment. Uganda. In May 2023, the Anti-Homosexuality Act, 2023 was signed into law, prescribing the death penalty for certain acts of "aggravated homosexuality". These are defined as: those who have homosexual sex with minors, with persons aged over 75 years, persons with disabilities, without or unable to consent, or with a person who is mentally ill. Anyone convicted of homosexuality more than once, or having infected others with a serious infectious disease such as HIV/AIDS, are also liable to be convicted as perpetrators of "aggravated homosexuality". Yemen. Punishment for homosexuality in Yemen can originate from the codified penal code, or from people seeking to enforce traditional Islamic morality. Article 264 of the national penal code prohibits private consensual homosexual acts between adult men. The stipulated punishment in the law for unmarried men is 100 lashes and up to a year in prison. The law stipulates that married men convicted of homosexuality are to be put to death by stoning. Article 268 of the national penal code prohibits private consensual homosexual acts between adult women. The law stipulates that premeditated acts of lesbianism are punished with up to three years in prison. In addition to the penal code, punishment for homosexuality can originate from people seeking to enforce traditional morality within their own family or for the broader society. In vigilante cases such as this, the punishment for homosexuality is oftentimes death.

Legality unclear According to the ILGA, there are five UN-member countries where the status of the death penalty as a punishment for same-sex sexual conduct is uncertain. This may be because experts or legal scholars dispute the effect of legal provisions, or because the laws relied upon to potentially sanction the death penalty are the provisions which relate to all sexual behaviours outside marriage, with applicability to homosexual relations uncertain, and so far, only theoretical.

, these jurisdictions are: Afghanistan. The Islamic Republic of Afghanistan enacted a Penal Code in February 2018 explicitly criminalising same-sex sexual conduct, stipulating prison sentences as the punishment. While the ILGA wrote that a "high-profile Islamic scholar" has stated there was a "broad consensus amongst scholars that execution was the appropriate punishment if homosexual acts could be proven", this could only be achieved under provisions, applicable to all sexual contact outside marriage. The sharia category of (illicit sexual intercourse) according to some traditional Islamic legal schools may entail the hadd (sharia-prescribed) punishment of stoning, when strict evidential requirements are met. The Hanafi school, prevalent in Afghanistan, does not regard homosexual acts as a hadd crime, although Afghan judges may have potentially applied the death penalty for a number of reasons. No known death sentences for homosexuality occurred after the end of Taliban rule in 2001. However, following the Taliban takeover of Afghanistan in 2021, fears of reprisal including death for those suspected of homosexuality were renewed. A Taliban spokesman told Reuters in 2021: "LGBT... That's against our Sharia law". A Taliban judge said that "For homosexuals, there can only be two punishments: either stoning, or he must stand behind a wall that will fall down on him". Pakistan. Hudood punishments for homosexuality include execution. However, the Hudood Ordinances have not been enforced "since the 1985 lifting of martial law", according to the U.S. State Department, and there are no known cases of Hudood being applied to same-sex sexual conduct. No known executions for homosexual activity have ever occurred in Pakistan. Qatar. Same-sex sexual activity is prohibited under the Penal Code 2004, which criminalises acts of "sodomy" and "sexual intercourse" between people of the same sex. These provisions carry a maximum penalty of seven years' imprisonment. Both men and women are criminalised under this law. The death penalty may be applicable to Muslims, for certain types of extramarital sex regardless of the gender of the participants. However, there is no evidence that the death penalty has been applied for consensual same-sex relations in private taking place between adults. Somalia. Insurgents and Somali officials have imposed sharia-based law in several southern states. In territories controlled by al-Shabaab homosexuality is punishable by death. United Arab Emirates. On occasion, Sharia courts have gone beyond codified laws and imposed sentences of stoning or flogging for crimes, thus theoretically making same-sex sexual activity liable to the death penalty, as occurring outside marriage. While adherence of the country's legal system to sharia allows for capital punishment for same-sex sexual activity— as with other sex acts by married persons outside marriage under provisions, there are no known instances of imposition of the death penalty , according to the British non-profit Human Dignity Trust, the , the U.S. Department of State, and other organizations.

Extrajudicial executions

In some regions, gay people have been murdered by Islamist militias and terrorist groups, such as Islamic State of Iraq and the Levant in parts of Iraq, Libya, and Syria, the Houthi movement in Yemen, in Malaysia. Reported gay killings by Hamas in the Gaza Strip have been either attributed to a combination of espionage charges and homophobia or debunked as having happened elsewhere (see below). In Sub-Saharan Africa killings have been reported in regions of Africa heavily influenced by conservative Christianity and Islam (see below). In some Christian majority regions, like some areas of Brazil, LGBT people have been consistently murdered due to conservative or religious beliefs (see below).

Afghanistan

Following the Fall of Kabul in 2021, several international LGBTQ+ organizations like Canada-based Rainbow Railroad reported increased violence against gay men by members of the Taliban and other Islamic extremists, with the victims not being subjected to any trial or legal proceeding, considering that homosexuality is punishable by death in Afghanistan. The reports included testimonies from young gay men who denounced kidnapping, torture, and rape since the Taliban takeover in August 2021.

The most known case since the return of the Taliban has been the murder of Hamed Sabouri, a 22-year-old gay medical student from Kabul who was kidnapped at a Taliban checkpoint and tortured for three days before being shot to death. Sabouri's ordeal was filmed by his captors and sent to his brother Haseeb, who sold the family's properties in Kabul and fled to Turkey. Similarly, Sabouri's boyfriend, a member of an underground and clandestine LGBTQ+ organization in Afghanistan, said that the Taliban was looking for him, calling them "wild animals" for killing his boyfriend.

Taliban spokesman Zabihullah Mujahid denied direct Taliban responsibility in the killing and added that the government had no knowledge of the case.

Brazil

Brazil is the country with the highest number of fatalities within the LGBTQ community, as stated in 2024 by The Federal Public Defenders’ Office in its input to the Special Rapporteur on extrajudicial, summary or arbitrary execution about the murder of LGBTQIAPN+ individuals in Brasil.