Lesbian, gay, bisexual, transgender, and queer (LGBTQ) rights in Africa are generally lacking, especially in comparison to much of the Americas, Europe and Oceania. There are an estimated fifty million Africans who are non-heterosexual.

As of June 2026, homosexuality is outlawed in 33 of the 54 African states recognised by the United Nations. In Eswatini, Ghana, Sierra Leone, and Zimbabwe, only male homosexuality is criminalised. In Egypt, despite no law explicitly criminalising homosexual acts, the state uses several morality provisions for the de facto criminalization of homosexual conduct.

According to the Human Rights Watch, in some countries whilst homosexuality itself is not illegal, there are discriminatory laws specifically targeting homosexual acts. In former British colonies, including Kenya and Nigeria, laws criminalising homosexuality are typically traceable to the colonial era. In states where homosexuality is legal, there is often little to no discrimination protection for homosexuals in areas such as employment.

In southern Somalia, Somaliland, Mauritania, northern Nigeria, and Uganda (in aggravated cases), homosexuality is punishable by death. In Gambia, Sudan, Sierra Leone, Tanzania, Uganda, and Zambia, offenders can receive life imprisonment for homosexual acts - although this is not enforced in Sierra Leone.

Homosexuality has never been criminalised in Benin, Central African Republic, Djibouti, Côte d'Ivoire, the Democratic Republic of the Congo, the Republic of the Congo, Equatorial Guinea, Madagascar, and Rwanda. It has been decriminalised in Angola, Botswana, Cape Verde, Gabon, Guinea-Bissau, Lesotho, Mauritius, Mozambique, Namibia, São Tomé and Príncipe, Seychelles, and South Africa. However, in four of these countries (Gabon, Côte d'Ivoire, Republic of the Congo, and Madagascar), the age of consent is higher for same-sex sexual relations than for opposite-sex ones. Since June 2024, Namibia is the most recent country in Africa to decriminalise homosexuality.

In November 2006, South Africa became the first country in Africa and the fifth country in the world to legalise same-sex marriage. In May 2023, the Supreme Court of Namibia ruled foreign same-sex marriages must be recognised equally to heterosexual marriages. This ruling was overturned in December 2024, when a new act was signed into law which explicitly forbid same-sex marriages and the recognition of those performed abroad. Spanish, Portuguese, British, and French overseas territories in Africa have legalised same-sex marriage.

LGBTQ anti-discrimination laws exist in eleven African countries: Angola, Botswana, Cape Verde, Equatorial Guinea, Lesotho, Mauritius, Mozambique, Namibia, São Tomé and Príncipe, Seychelles, and South Africa. Botswana, Mauritius, and South Africa are the only countries in Africa in which discrimination against the LGBTQ community is constitutionally illegal. In other countries, there are limited discrimination protections.

Travel advisories encourage gay and lesbian travelers to use discretion in much of the continent to ensure their safety. This includes avoiding public displays of affection (although this can often apply to both homosexual and heterosexual couples).

Recent developments In a 2011 UN General Assembly declaration for LGBTQ rights, nation states were given a chance to express their support, opposition, or abstention on the topic. Only Cape Verde, Central African Republic, Gabon, Guinea-Bissau, Mauritius, Rwanda, São Tomé and Príncipe, Seychelles, Sierra Leone, and South Africa expressed their support. A majority of African countries expressed their opposition. State parties that expressed abstention were Angola, Botswana, Burkina Faso, Burundi, Democratic Republic of the Congo, Equatorial Guinea, Ghana, Lesotho, Liberia, Madagascar, Mozambique, Namibia, Republic of the Congo, and Zambia.

In 2006, South Africa became the first country in Africa and the fifth in the world to legalise same-sex marriage. There are large LGBTQ communities in South Africa's urban areas, including Johannesburg, Cape Town, Durban, Pretoria, Port Elizabeth, East London, Bloemfontein, Nelspruit, Pietermaritzburg, Kimberley, and George. South Africa's three largest cities, Johannesburg, Durban, and Cape Town, are frequently promoted as tourist destinations for LGBTQ people. However social discrimination against LGBTQ people in South Africa does still occur, especially in rural areas where it is fueled by a number of religious figures and traditions.

While South Africa is often perceived as the most supportive African country for LGBTQ rights, nations like Namibia, Cape Verde, Mauritius, Seychelles, Angola, Botswana, Mozambique, São Tomé and Príncipe, Lesotho, and Equatorial Guinea are also recognized for their social acceptance and tolerance of LGBTQ people and having discrimination protections.

In 2010, a cisgender man, Steven Monjeza Soko, and a transgender woman, Tiwonge Chimbalanga Kachepa, were arrested by the Malawi police and charged following their engagement ceremony, despite no evidence of the two having sex. The court denied bail, sentencing both Soko and Kachepa to prison.

Nicholas Hersh reports that LGBTQ asylum-seekers and refugees in Morocco often fear for their lives. Queer Moroccan Refugees have been subject to social discrimination and violence, including rape and imprisonment. Queer Moroccan Refugees who have been outed in their communities may experience poverty, frequently turning to sex work in exchange for housing.

In recent years, although many countries have made progress with decriminalization, some countries in which homosexuality is illegal have introduced harsher penalties. In addition to criminalizing homosexuality, Nigeria has recently enacted legislation prohibiting the support of LGBTQ rights. According to Nigerian law, a heterosexual ally "who administers, witnesses, abets or aids" any form of gender non-conforming and homosexual activity could receive a ten-year jail sentence. Uganda's Anti-Homosexuality Act of 2023, which permits the use of capital punishment for certain types of consensual same-sex activities, has also garnered significant international attention.

Burundi became the first country in the 21st century to criminalize sodomy in 2009, followed by Chad in 2017, Mali in 2024, Burkina Faso in 2025, and Niger in 2026. Previously, these countries never had any laws against consensual same-sex activity. Conversely, some African states have abolished sodomy laws in the 21st century. Cape Verde in 2004, Lesotho and São Tomé and Príncipe in 2012, Mozambique in 2015, Seychelles in 2016, Botswana in 2019, Angola in 2021, Mauritius in 2023, and Namibia in 2024. Legalization is proposed in some African states like Eswatini, Ghana, Kenya, Liberia, Malawi, Togo, Zambia and Zimbabwe. Gabon passed a law criminalizing sodomy in 2019, but reversed its decision in 2020, when it decriminalized homosexuality.

Since 2011, some developed countries have implemented, or considered implementing, laws limiting or prohibiting general budget support to countries that restrict the rights of LGBTQ people. Rather than fueling the granting of greater LGBTQ rights, in some areas, this has exacerbated homophobic sentiments. Past African leaders such as Zimbabwe's Robert Mugabe and Uganda's Yoweri Museveni have claimed that homosexuality is an "un-African" import from Europe. However, most scholarship and research demonstrate that homosexuality has long been a part of various African cultures.Anthony Appiah and Henry Louis Gates, Encyclopedia of Africa, Volume 2 OUP, USA, 2010

History

Ancient history

Egypt

Ancient Egypt had documented third gender categories, including for eunuchs. In the Tale of Two Brothers (from 3,200 years ago), Bata removes his penis and tells his wife "I am a woman just like you"; one modern scholar called him temporarily (before his body is restored) "transgendered".

Ancient Egyptian attitudes towards homosexuality remain unclear. There are no records condemning or penalising homosexuality, but documents that make reference to sexuality do not clearly reference specific sexual acts. Thus, a simple evaluation remains problematic.Emma Brunner-Traut: Altägyptische Märchen. Mythen und andere volkstümliche Erzählungen. 10th Edition. Diederichs, Munich 1991, , pp. 178–179.

The best-known case of possible homosexuality in ancient Egypt is that of the two high officials Niankhkhnum and Khnumhotep. Both men lived and served under Pharaoh Niuserre during the 5th Dynasty (c. 2494–2345 BC). Both Niankhkhnum and Khnumhotep had wives and children, but were buried together in one mastaba tomb. In this mastaba, several paintings depict the men embracing and touching the tips of their noses together. In ancient Egypt, this gesture typically represented a kiss. There has been much disagreement between Egyptologists and historians over how these paintings should be interpreted. Some scholars believe that the paintings reflect a same-sex relationship between two married men, suggesting the ancient Egyptians were accepting of homosexuality. Other scholars interpret the scenes as evidence that Niankhkhnum and Khnumhotep were twins, possibly conjoined twins.

The Roman Emperor Constantine in the 4th century AD is said to have exterminated a large number of "effeminate priests" based in Alexandria.

Modern history

North Africa There is well-documented evidence of homosexuality in Northern Africa - particularly from the period of Mamluk rule. Arabic poetry emerging from cosmopolitan regions describes the pleasures of pederastic relationships, including accounts of Christian boys sent from Europe to become sex workers in Egypt. In Cairo, cross-dressing men called khawal would entertain audiences with song and dance - a tradition thought to be of pre-Islamic origin.

Accounts of early twentieth-century travellers, frequently include accounts of homosexuality in the Siwa Oasis in Egypt. Group of warriors in the region were known to pay reverse dowries to younger men, a practice later outlawed in the 1940s.

British anthropologist Siegfried Frederick Nadel wrote about the Nuba tribes in Sudan in the late 1930s. He noted traditional roles amongst the Otoro Nuba where male-assigned people would dress and live as women and marry men. Similar gender roles exist amongst the Moru, Nyima, Krongo, Mesakin and Tira people. In the Korongo and Mesakin tribes, Nadel also reported a common reluctance amongst men to abandon the pleasures of all-male camp life for the fetters of permanent settlement.

In the late 1980s, Mufti Muhammad Sayyid Tantawy of Egypt issued a fatwa supporting the right for those who fit the description of mukhannathun and mukhannathin to have sex reassignment surgery.

East Africa In pre-colonial East Africa, male-assigned priests (called mugawe among the Meru and Kikuyu) would dress and style their hair like women and marry men.[page needed] A similar role has historically existed within the Swahili-speaking Mashoga - with some male-assigned people taking on women's names and traditional gender roles.

Among the Nuer people (in what is now South Sudan and Ethiopia), widows who bore no children would sometimes adopt male statuses and marry women (a practice which has been viewed as transgender or homosexual); the Nuer also have a traditional male-to-female role. The Maale people of Ethiopia have a traditional role for male-assigned ashtime who take on feminine roles; traditionally, they served as sexual partners for the king on days he was ritually barred from sex with women. The Life and Struggles of Our Mother Wälättä P̣eṭros (1672) makes the first reference to homosexuality between nuns in Ethiopian literature. The Amhara people have historically stigmatized men who adopted feminine dress.

Uganda