Background: Rotavirus gastroenteritis causes many deaths in infants in sub-Saharan Africa. Because rotavirus vaccines have proven effective in developed countries but had not been tested in developing countries, we assessed efficacy of a pentavalent rotavirus vaccine against severe disease in Ghana, Kenya, and Mali between April, 2007, and March, 2009. Methods: In our multicentre, double-blind, placebo-controlled trial, undertaken in rural areas of Ghana and Kenya and an urban area of Mali, we randomly assigned infants aged 4-12 weeks without symptoms of gastrointestinal disorders in a 1:1 ratio to receive three oral doses of pentavalent rotavirus vaccine 2 mL or placebo at around 6 weeks, 10 weeks, and 14 weeks of age. Infants with HIV infection were not excluded. Randomisation was done by computer-generated randomisation sequence in blocks of six. We obtained data for gastrointestinal symptoms from parents on presentation to health-care facilities and clinical data were obtained prospectively by clinicians. The primary endpoint was severe rotavirus gastroenteritis (Vesikari score ≥11), detected by enzyme immunoassay, arising 14 days or more after the third dose of placebo or vaccine to end of study (March 31, 2009; around 21 months of age). Analysis was per protocol; infants who received scheduled doses of vaccine or placebo without intervening laboratory-confirmed naturally occurring rotavirus disease earlier than 14 days after the third dose and had complete clinical and laboratory results were included in the analysis. This study is registered with ClinicalTrials.gov, number NCT00362648. Findings: 5468 infants were randomly assigned to receive pentavalent rotavirus vaccine (n=2733) or placebo (n=2735). 2357 infants assigned to vaccine and 2348 assigned to placebo were included in the per-protocol analysis. 79 cases of severe rotavirus gastroenteritis were reported in 2610·6 person-years in the vaccine group, compared with 129 cases in 2585·9 person-years in the placebo group, resulting in a vaccine efficacy against severe rotavirus gastroenteritis of 39·3 (95 CI 19·1-54·7, p=0·0003 for efficacy >0). Median follow-up in both groups was 527 days starting 14 days after the third dose of vaccine or placebo was given. 42 (1·5) of 2723 infants assigned to receive vaccine and 45 (1·7) of 2724 infants assigned to receive placebo had a serious adverse event within 14 days of any dose. The most frequent serious adverse event was gastroenteritis (vaccine 17 [0·6]; placebo 17 [0·6]). Interpretation: Pentavalent rotavirus vaccine is effective against severe rotavirus gastroenteritis in the first 2 years of life in African countries with high mortality in infants younger than 5 years. We support WHO's recommendation for adoption of rotavirus vaccine into national expanded programmes on immunisation in Africa.