Across much of Africa, gay people face discrimination, persecution, and potentially even death.
The East African country of Tanzania has been cracking down on expressions of homosexuality recently. The home affairs minister has threatened to shut down NGOs promoting gay rights, while even the president has weighed in, stating somewhat bizarrely that "even cows disapprove" of same-sex relations.
This attitude is indicative of widespread social norms, and indeed laws, across much of the continent. Thirty-three African countries criminalize homosexual behavior and/or attraction, out of a total of 54 nations.
Here's a map and details of where it's illegal to be gay in Africa. The information comes from the 2017 report by the International Lesbian, Gay, Bisexual, Trans and Intersex Association (ILGA).
Algeria
Gay sex is punishable by imprisonment of up to two years and a fine of up to 2,000 Algerian dinars ($19).
Angola
Sexually-active gay people can have security measures imposed on them, including probation or internment in a workhouse or farming colony for up to three years. The country is currently in the process of adopting a law that repeals provisions against same-sex relationships.
Botswana
Anyone who has "carnal knowledge of any person against the order of nature"—a phrase often used in legal codes to refer to homosexual activity—can be sentenced to prison for up to seven years.
Burundi
The East African state punishes homosexual activity with imprisonment of up to two years and a fine of up to 100,000 Burundian francs ($58).
Cameroon
The West African country punishes same-sex relations with prison sentences of up to five years and a maximum fine of 200,000 Central African CFA francs ($348).
Comoros
The archipelago off Africa's east coast punishes gay sex with a prison sentence of up to five years and 1 million Comorian francs ($2,322).
Egypt
Egyptian law does not specifically proscribe consensual homosexual relations between adults, but other laws—including those banning debauchery and prostitution—have been used to imprison gay men in the past.
Eritrea
Same-sex relations are punishable by simple imprisonment—i.e. jail time which does not involve hard labor—according to Eritrea's law code; the sentence is not clarified.
Ethiopia
The Horn of Africa country punishes "a homosexual act, or any other indecent act" with simple imprisonment, with no specified sentence. It hands out harsher sentences for homosexual activity that results in the transmission of sexually-transmitted diseases.
Gambia
The tiny West African country punishes sexually-active gay people with prison terms of up to 14 years; oral and anal sex are included under the law. Gay people can face life imprisonment if one of the partners is under 18 years old or if one has HIV.
Ghana
Ghanaian law defines consensual homosexual sex as a "misdemeanor," punishable by three years' imprisonment. Homosexual sex without consent is classified as a first-degree felony and can carry a 25-year prison term. The laws apply only to men, according to ILGA.
Guinea
Sexual acts between persons of the same gender are punishable by three years' imprisonment and a maximum fine of 1 million Guinean francs ($111).
Kenya
The East African giant punishes homosexual sex between men with 14 years' imprisonment, which goes up to 21 years if it is not consensual. The law only applies to men.
Liberia
Liberian law defines homosexuality—along with oral sex and sex or sexual touching between unmarried heterosexual persons—as "deviate sexual intercourse," which is classed as a first-degree misdemeanour carrying a one-year prison sentence.
Libya
The North African state punishes what it regards as "illicit sexual intercourse" with five years' imprisonment.
Malawi
Homosexual activity is punishable by 14 years' imprisonment, potentially with corporal punishment (such as caning or flogging).
Mauritania
The Islamic republic prescribes death by stoning for men who have homosexual sex, though it has had a de facto moratorium on the penalty for almost 30 years. Homosexual activity between women is punishable by two years' imprisonment and a fine of up to 60,000 Mauritanian ouguiya ($167).
Mauritius
"Sodomy" carries a penalty of five years' imprisonment. It applies only to men.
Morocco
"Anyone who commits lewd or unnatural acts" with others of the same sex can face a prison term of up to three years in Morocco and a fine of up to 1,000 dirhams ($104), unless there are "aggravating circumstances."
Namibia
Sodomy is classed as a common law offense in Namibia, though no sentence is prescribed. It applies only to men.
Nigeria
Nigerian law carries a 14-year prison sentence for homosexual activity. Twelve states in northern Nigeria—which is predominantly Muslim—have adopted shariah law, under which the maximum penalty for homosexual activity between men is death, and for women is whipping and/or imprisonment.
Senegal
Homosexual sex is punishable by a maximum sentence of five years' imprisonment and a fine of up to 1.5 million ($2,613).
Sierra Leone
The act of "buggery"—generally defined as anal intercourse, but also bestiality—carries a minimum sentence of 10 years in prison or a maximum sentence of life imprisonment. It only applies to men.
Somalia
Somalia's penal code punishes gay sex with a prison sentence of up to three years. The implementation of the penal code is limited, however, since the federal government in the capital Mogadishu exerts limited control over the country. In southern areas controlled by Al-Shabab, a strict interpretation of sharia law is implemented and homosexual sex is punishable by death.
South Sudan
The world's youngest country punishes what it calls "carnal intercourse against the order of nature" with a prison sentence of up to 10 years. It also proscribes qadhf—falsely accusing someone of homosexuality or other forms of sexual activity forbidden under South Sudanese law—and the offense carries a penalty of 80 lashes.
Sudan
Sudanese law carries incremental punishments for "sodomy," defined as anal sex between persons of the same sex or different sexes. First offenders face 100 hundred lashes and five years' imprisonment; second offenders face the same punishment; but third offenders can be sentenced to death or life imprisonment. Sudan also proscribes qadhf.
Swaziland
Same-sex relations are a common law offense. The law applies only to men, although homosexual women also often face discrimination and violence.
Tanzania
Homosexual activity is punishable by a minimum term of 30 years in prison or a maximum term of life.
Togo
The West African state punishes same-sex activity with prison sentences of between one and three years and fines of up to 500,000 West African CFA francs ($871). The law applies only to men.
Tunisia
"Sodomy" is punishable by three years' imprisonment; the term includes both male and female homosexual activity.
Uganda
Homosexual activity between men or women is punishable by life imprisonment, though its enforcement is variable.
Zambia
Same-sex relations are punishable by a minimum jail sentence of 15 years, and a maximum sentence of life imprisonment.
Zimbabwe
Men who practice anal intercourse or perform other so-called "indecent acts" can face a prison sentence of up to one year and a fine.
Uncommon Knowledge
Newsweek is committed to challenging conventional wisdom and finding connections in the search for common ground.
Newsweek is committed to challenging conventional wisdom and finding connections in the search for common ground.
About the writer
Conor is a staff writer for Newsweek covering Africa, with a focus on Nigeria, security and conflict.
To read how Newsweek uses AI as a newsroom tool, Click here.