According to a 2020 global review by the International Lesbian, Gay, Bisexual, Trans, and Intersex Association (ILGA), nearly half of the countries worldwide where homosexuality is outlawed are in Africa.
Out of 54 African countries, only one African country has legalised homosexual acts between consenting adults.
In several others, same-sex relationships remain punishable by imprisonment, and in four other African countries, like Mauritania, Nigeria (in states where sharia law applies), Somalia, and South Sudan, the law allows for the death penalty.
Even in African countries, where same-sex relationships have been legalised or decriminalised, LGBTQIA+ people often continue to face stigma, discrimination, and violence.
The African Country That Legalised Same-Sex Relationships
South Africa is the only sovereign country in Africa where same-sex marriage is legal.
In 2006, South Africa passed the Civil Union Act (Act No. 17 of 2006), which allows two people of any sex to marry or enter a civil partnership.
Its constitution also protects people from discrimination based on sexual orientation. Furthermore, in 2020, President Cyril Ramaphosa signed the Civil Union Amendment Act, which prevents marriage officers from refusing to conduct same-sex marriages.
Namibia stands out as the only other African country that legally recognises same-sex marriages performed abroad, even though it does not conduct such marriages locally.
Despite strong legal protections, South Africa still faces serious challenges, including persistent hate crimes against LGBTQIA+ people.
ALSO READ: What Are the 3 Largest Countries in Africa?
African Countries That Have Decriminalised Same-Sex Relationships

In the context of same-sex relationships, decriminalisation means that consensual relationships between adults of the same sex are not illegal. Police cannot use the law to harass, arrest, or charge people simply because of their sexual orientation.
However, decriminalisation does not automatically mean full legal equality.
Below are some African countries that have taken significant steps to decriminalise same-sex relationships in recent years.
1. Angola
Angola decriminalised same-sex relationships after a new penal code came into effect in February 2021. The law overturned a ban dating back to Portuguese colonial rule. It also introduced penalties for discrimination based on sexual orientation, with prison sentences of up to two years.
2. Botswana
In 2019, Botswana’s High Court decriminalised same-sex relationships for both men and women. The ruling struck down a 1965 colonial-era law that punished same-sex relations with up to seven years in prison. The decision marked a major human rights milestone for the country.
3. Mozambique
Mozambique removed a colonial-era provision that described same-sex relationships as “vices against nature” in 2015. While the country shows relatively high levels of tolerance, international observers note that LGBTQIA+ people still face discrimination and violence in daily life.
4. Lesotho
Lesotho fully decriminalised homosexuality in 2010. This legal change helped public health groups expand HIV and AIDS prevention efforts, particularly important in a country heavily affected by HIV.
5. Seychelles
In May 2016, Seychelles decriminalised same-sex acts after lawmakers amended Section 151 of the Penal Code, which had previously labelled sodomy a felony punishable by up to 14 years in prison. The reform followed a public commitment by then-President James Michel.
6. Mauritius
In October 2023, Mauritius became the latest African country to decriminalise same-sex relationships. The Supreme Court ruled that Section 250 of the Penal Code, which criminalised “sodomy,” was discriminatory and unconstitutional.
The court stated that the law unfairly targeted homosexual men while allowing heterosexual men the freedom to express their sexuality.