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.
In May, Kenya’s high court caused widespread dismay when it refused to scrap laws criminalising gay sex.
Chad, Nigeria and Burundi 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.