Key population HIV programmes in sub-Saharan Africa require epidemiological information to ensure equitable and universal access to effective services. We aimed to consolidate and harmonise survey data among female sex workers, men who have sex with men, people who inject drugs, and transgender people to estimate key population size, HIV prevalence, and antiretroviral therapy (ART) coverage for countries in mainland sub-Saharan Africa. Key population size estimates, HIV prevalence, and ART coverage data from 39 sub-Saharan Africa countries between 2010 and 2023 were collated from existing databases and verified against source documents. We used Bayesian mixed-effects spatial regression to model urban key population size estimates as a proportion of the gender-matched, year-matched, and area-matched population aged 15-49 years. We modelled subnational key population HIV prevalence and ART coverage with age-matched, gender-matched, year-matched, and province-matched total population estimates as predictors. We extracted 2065 key population size data points, 1183 HIV prevalence data points, and 259 ART coverage data points. Across national urban populations, a median of 1·65% (IQR 1·35-1·91) of adult cisgender women were female sex workers, 0·89% (0·77-0·95) were men who have sex with men, 0·32% (0·31-0·34) were men who injected drugs, and 0·10% (0·06-0·12) were women who were transgender. HIV prevalence among key populations was, on average, four to six times higher than matched total population prevalence, and ART coverage was correlated with, but lower than, the total population ART coverage with wide heterogeneity in relative ART coverage across studies. Across sub-Saharan Africa, key populations were estimated as comprising 1·2% (95% credible interval 0·9-1·6) of the total population aged 15-49 years but 6·1% (4·5-8·2) of people living with HIV. Key populations in sub-Saharan Africa experience higher HIV prevalence and lower ART coverage, underscoring the need for focused prevention and treatment services. In 2024, limited data availability and heterogeneity constrain precise estimates for programming and monitoring trends. Strengthening key population surveys and routine data within national HIV strategic information systems would support more precise estimates. UNAIDS, Bill & Melinda Gates Foundation, and US National Institutes of Health.