HIV disproportionately affects gay, bisexual, and other men who have sex with men (MSM) in Africa, where many countries criminalise same-sex behaviour. We assessed changes in the engagement of African MSM with HIV testing and treatment cascade stages over time, and the effect of anti-LGBT legislation and stigma.