Editor's note: This article was originally published on Feb. 25, 2021 and has been updated to include other countries across Africa that have legalised same-sex relationships since publication.

Nearly half of the countries worldwide where homosexuality is outlawed are in Africa, according to a 2020 global review by the International Lesbian, Gay, Bisexual, Trans, and Intersex Association (ILGA). 

In fact, out of the 54 African states, only 22 of them have legalized homosexuality. In some countries it is punishable by imprisonment, while it is punishable by death in four — Mauritania, Nigeria (in states where sharia law is applied), Somalia, and South Sudan. 

For the majority of African nations, anti-LGBTQIA+ laws date back to the colonial era. However, LGBTQIA+ communities continue to face stigma, discrimination, and widespread threats and violence as a result of their sexual orientation and gender identities to this day. 

In 2006, South Africa became the first and remains the only African country to legalize same-sex marriage, with a constitution that also protects against discrimination based on sexual orientation. A bill was also introduced in 2018, to criminalize hate crimes and hate speech, and in 2020 South Africa’s President Cyril Ramaphosa passed into law the Civil Union Amendment Act, which prohibits marriage officers from refusing to conduct same-sex marriages. 

While these developments are a great step forward on paper, in reality the country does still have a long way to go, with hate crimes against the LGBTQIA+ community still prevalent.

The legalizing of same-sex relationships is vital for equality, and improves the psychological, physical, and social well-being of LGBTQIA+ communities. Countries that are LGBTQIA+ friendly also tend to see a boost in tourism, with LGBTQIA+ travellers reportedly accounting for around 5-10% of global tourists.

It's important to remember that legalizing same-sex relationships is only the first step, and that even once same-sex relationships are legalized, LGBTQIA+ communities can still face oppression, discrimination, and violence.

Nevertheless, with a growing number of countries in Africa legalizing same-sex relationships, there has been a glimmer of hope on the continent in recent years.

Here are some of the countries in Africa that have legalized same-sex relationships in the last decade.

1. Angola 

Angola decriminalized same-sex relationships, after passing a new law that came into effect in February 2021. The new law overturned a ban on same-sex relationships that dates back to when the country was a Portuguese colony; and states that discrimination based on sexual orientation can be punishable by imprisonment of up to two years.

2. Botswana 

In a landmark moment for the country, Botswana's High Court decriminalized both male and female same-sex relationships in 2019. It replaced a law that had been in place since 1965, when the country was under British rule, which outlaws “carnal knowledge of any person against the order of nature” and was punishable by up to seven years in jail. 

3. Mozambique 

In 2015, Mozambique dropped a colonial-era clause outlawing same-sex relationships as "vices against nature" from its penal code. According to the Globe and Mail, the UN's independent expert on sexual orientation and gender identity, Victor Madrigal-Borloz, visited Mozambique in late 2018, and said it had a "high level of tolerance" — but warned that LGBTQIA+ people still face discrimination and violence at home, work, school, and when accessing health services or police support. 

4. Lesotho 

Before the current Penal Code Act, homosexuality was illegal for men, but in 2010 homosexuality was decriminilized entirely. Once the law came into effect, activism work with regards to HIV/AIDS was able to reach more people within the community in order to offer prevention strategies, as Lesotho is one of the countries hardest hit by HIV.  

5. Seychelles

Seychelles decriminalized “same-sex acts” in May 2016, after lawmakers voted to amend section 151 of the country’s Penal Code Act that referred to sodomy as a felony and made it punishable with up to 14 years in prison. The amendment came just three months after a national address by the nation's President James Michel, saying that his government would introduce a bill to abolish Section 151. 

6. Mauritius

Mauritius has become the latest African country to decriminalise same-sex relationships, joining a growing list of African countries scrapping such discriminatory colonial-era laws. In October 2023, the country’s supreme court ruled that Section 250 of the Mauritian Penal Code, which criminalised “sodomy”, was discriminatory and unconstitutional. In the ruling, the Court said the previous law “criminalises the only natural way for the plaintiffs and other homosexual men to have sexual intercourse, whereas heterosexual men are permitted the right to have sexual intercourse in a way which is natural to them.”


Demand Equity

6 Countries in Africa That Have Legalized Same-Sex Relationships in the Past 10 Years

By Aaron Rakhetsi