More than half of the countries in sub-Saharan Africa have anti-homosexuality laws, although others have moved towards legal tolerance, watchdogs say.
Twenty-eight out of 49 countries have laws penalising same-sex relationships, according to Neela Ghoshal, a Human Rights Watch (HRW) specialist in lesbian, gay, bisexual, and transgender rights.
The death penalty is on the books, under sharia, in Mauritania, Sudan and northern Nigeria, although there have been no known executions in recent times.
In southern Somalia, gay men are believed to have been put to death in territory ruled by the Al Shabaab jihadist group.
However, Angola, Mozambique and Seychelles have scrapped anti-gay laws in recent years, and on Friday a High Court ruling in Nairobi will determine whether Kenya follows suit.
On the other hand, Chad and Uganda have introduced or toughened legislation.
Rights groups say many anti-gay laws date from the colonial area.
They represent a peril even in countries where they are not implemented, according to campaigners, as their existence on the statute books entrenches stigma and encourages harassment, they say.
Following is a snapshot of the legal situation in Africa, provided by AFP bureaux: