In the absence of a licensed vaccine, Clostridioides (formerly Clostridium) difficile infection represents a substantial health burden. The aim of this study was to evaluate the efficacy, immunogenicity, and safety of a toxoid vaccine candidate. We did a phase 3 multicentre, observer-blind, randomised, controlled trial at 326 hospitals, clinics, and clinical research centres in 27 countries in the USA, Canada, Latin America, Europe, and the Asia-Pacific region. We included adults aged 50 years or older who were considered to be at an increased risk of C difficile infection because they had previously had two hospital stays (each ≥24 h in duration) and had received systemic antibiotics in the previous 12 months (risk stratum 1), or because they were anticipating being admitted to hospital for 72 h or more for elective surgery within 60 days of enrolment (risk stratum 2). Eligible participants were stratified by geographical region and the two risk strata, and randomly assigned (2:1), with a fixed block size of three, to receive either a C difficile toxoid vaccine candidate, containing toxoids A and B (C difficile vaccine candidate group), or a placebo vaccine (placebo group). Participants, investigators, and personnel responsible for collecting safety data and analysing blood and stool samples were masked to group assignment. Personnel responsible for study product preparation and administration were not masked to group assignment. One dose (0·5 mL) of C difficile vaccine candidate or placebo vaccine was administered intramuscularly on days 0, 7, and 30. The primary outcome was the efficacy of the vaccine in preventing symptomatic C difficile infection, defined as having three or more loose stools in a period of 24 h or less, loose stools for 24 h or more, and a PCR-positive test for C difficile toxin B in a loose stool sample, within 3 years after the final vaccine dose. The primary outcome was measured in the modified intention-to-treat population (ie, all participants who received at least one injection of the assigned vaccine). The safety of the vaccine was assessed in the safety analysis set (ie, all participants who had received at least one injection, analysed according to the product received). This study is registered with WHO/ICTRP, number U111-1127-7162, and ClinicalTrials.gov, number NCT01887912, and has been terminated. Between July 30, 2013, and Nov 17, 2017, we enrolled and randomly assigned 9302 participants to the C difficile vaccine candidate group (n=6201) or to the placebo group (n=3101). 6173 (99·5%) participants in the C difficile vaccine candidate group and 3085 (99·5%) participants in the placebo group received at least one dose of the vaccine. The study was terminated after the first planned interim analysis because of futility. In the C difficile vaccine candidate group, 34 C difficile infections were reported over 11 697·2 person-years at risk (0·29 infections per 100 person-years [95% CI 0·20-0·41]) compared with 16 C difficile infections over 5789·4 person-years at risk in the placebo group (0·28 infections per 100 person-years [0·16-0·45]), indicating a vaccine efficacy of -5·2% (95% CI -104·1 to 43·5). In the C difficile vaccine candidate group, 2847 (46·6%) of 6113 participants reported an adverse event within 30 days of injection compared with 1282 (41·9%) of 3057 participants in the placebo group. The proportion of participants who had an adverse event leading to study discontinuation was 4·8% in both groups (296 participants in the C difficile vaccine candidate group and 146 participants in the placebo group). 1662 (27·2%) participants in the C difficile vaccine candidate group reported at least one serious adverse event compared with 851 (27·8%) participants in the placebo group. In adults at risk for C difficile infection, a bivalent C difficile toxoid vaccine did not prevent C difficile infection. Since the C difficile vaccine candidate met the criteria for futility, the study was terminated and clinical development of this vaccine candidate was stopped. Sanofi Pasteur.