Background: Recipients of autologous haemopoietic stem-cell transplants (auto-HSCT) have an increased risk of herpes zoster and herpes zoster-related complications. The aim of this study was to establish the efficacy and safety of an inactivated varicella zoster vaccine for the prevention of herpes zoster after auto-HSCT. Methods: In this randomised, double-blind, placebo-controlled phase 3 trial, participants were recruited from 135 medical centres (ie, stem-cell transplant centres and hospitals) in North America, South America, Europe, and Asia. Patients were eligible if they were aged 18 years or older, scheduled to receive an auto-HSCT within 60 days of enrolment, and had a history of varicella infection or were seropositive for antibodies to varicella zoster virus, or both. Exclusion criteria included a history of herpes zoster within the previous year of enrolment, and intended antiviral prophylaxis for longer than 6 months after transplantation. Participants were randomly assigned according to a central randomisation schedule generated by the trial statistician, to receive either the inactivated-virus vaccine from one of three consistency lots, a high-antigen lot, or placebo, stratified by age (<50 vs ≥50 years) and intended duration of antiviral prophylaxis after transplantation (≤3 months vs >3 to ≤6 months). Participants, investigators, trial staff, and the funder's clinical and laboratory personnel were masked to group assignment. Participants were given four doses of inactivated vaccine or placebo, with the first dose 5–60 days before auto-HSCT, and the second, third, and fourth doses at about 30, 60, and 90 days after transplantation. The primary efficacy endpoint was the incidence of herpes zoster, confirmed by PCR or adjudication by a masked clinical committee, or both, assessed in all participants randomly assigned to the vaccine consistency lot group or placebo group who received at least one dose of vaccine and had auto-HSCT. Safety was assessed in all randomised participants who received at least one dose of vaccine and had follow-up data. A prespecified vaccine efficacy success criterion required the lower bound of the 95% CI be higher than 25% for the relative reduction of the hazard ratio of herpes zoster infection in participants given the vaccine from one of the consistency lots compared with those given placebo. This trial is registered on ClinicalTrials.gov (NCT01229267) and EudraCT (2010–020150–34). Findings: Between Dec 7, 2010, and April 25, 2013, 560 participants were randomly assigned to the vaccine consistency lot group, 106 to the high-antigen lot group, and 564 to the placebo group. 249 (44%) of patients in the vaccine consistency lot group, 35 (33%) in the high-antigen lot group, and 220 (39%) in the placebo group discontinued before study end, mostly because of death or withdrawal. 51 participants were excluded from the primary efficacy endpoint analyses because they did not undergo auto-HSCT or were not vaccinated, or both (22 [4%] in the vaccine consistency lot group, and 29 [5%] in the placebo group). Mean follow-up for efficacy was 2·4 years (SD 1·3) in the vaccine consistency lot group and 2·3 years (SD 1·3) in the placebo group. 42 (8%) of 538 participants in the vaccine consistency lot group (32·9 per 1000 person-years) and 113 (21%) of 535 in the placebo group (91·9 per 1000 person-years) had a confirmed case of herpes zoster. The estimated vaccine efficacy was 63·8% (95% CI 48·4–74·6), meeting the pre-specified success criterion. For the combined vaccine groups versus the placebo group, the proportion of patients with serious adverse events (216 [33%] of 657 vs 181 [33%] of 554; risk difference 0·2%, 95% CI −5·1 to 5·5) and serious vaccine-related adverse events (five [1%] vs five [1%]; risk difference 0·1%, −1·4 to 1·1) were similar. Vaccine-related injection-site adverse events occurred more frequently in participants given vaccine than those given placebo (191 [29%] vs 36 [7%]; risk difference 22·6%, 95% CI 18·5–26·6; p<0·0001). Interpretation: This study shows for the first time in a large phase 3 trial that early vaccination of auto-HSCT recipients during the peri-transplant period can be effective for the prevention of an opportunistic infection like herpes zoster and that the vaccine is well tolerated. Funding: Merck & Co., Inc.