There are few data on the real-world effectiveness of COVID-19 vaccines and boosting in Africa, which experienced widespread SARS-CoV-2 infection before vaccine availability. We assessed the association between vaccination and severe COVID-19 in the Western Cape, South Africa, in an observational cohort study of >2 million adults during 2020–2022. We described SARS-CoV-2 testing, COVID-19 outcomes, and vaccine uptake over time. We used multivariable cox models to estimate the association of BNT162b2 and Ad26.COV2.S vaccination with COVID-19-related hospitalization and death, adjusting for demographic characteristics, underlying health conditions, socioeconomic status proxies, and healthcare utilization. We found that by the end of 2022, 41% of surviving adults had completed vaccination and 8% had received a booster dose. Recent vaccination was associated with notable reductions in severe COVID-19 during periods dominated by Delta, and Omicron BA.1/2 and BA.4/5 (sub)lineages. During the latest Omicron BA.4/5 wave, within 3 months of vaccination or boosting, BNT162b2 and Ad26.COV2.S were each 84% effective against death (95% CIs: 57–94 and 49–95, respectively). However, distinct reductions of effectiveness occurred at longer times post completing or boosting vaccination. Results highlight the importance of continued emphasis on COVID-19 vaccination and boosting for those at high risk of severe COVID-19, even in settings with widespread infection-induced immunity.