Background: The HVTN 503/Phambili study, which assessed the efficacy of the Merck Ad5 gag/pol/nef subtype B HIV-1 preventive vaccine in South Africa, was stopped when futility criteria in the Step study (assessing the same vaccine in the Americas, Caribbean, and Australia) were met. Here we report long-term follow-up data. Methods: HVTN 503/Phambili was a double-blind, placebo-controlled, randomised trial that recruited HIV-1 uninfected, sexually active adults aged 18-35 years from five sites in South Africa. Eligible participants were randomly assigned (1:1) by computer-generated random numbers to either vaccine or placebo, stratified by site and sex. Cox proportional hazards models were used to estimate HIV-1 infection in the modified intention-to-treat cohort, all of whom were unmasked early in follow-up. The trial is registered with ClinicalTrials.gov, number NCT00413725 and the South African National Health Research Database, number DOH-27-0207-1539. Findings: Between Jan 24, 2007, and Sept 19, 2007, 801 participants (26·7%) of a planned 3000 were randomly assigned (400 to vaccine, 401 to placebo); 216 (27%) received only one injection, 529 (66%) received only two injections, and 56 (7%) received three injections. At a median follow-up of 42 months (IQR 31-42), 63 vaccine recipients (16%) had HIV-1 infection compared with 37 placebo recipients (9%; adjusted HR 1·70, 95% CI 1·13-2·55; p=0·01). Risk for HIV-1 infection did not differ according to the number of vaccinations received, sex, circumcision, or adenovirus type 5 (Ad5) serostatus. Differences in risk behaviour at baseline or during the study, or annualised dropout rate (7·7% [95% CI 6·2-9·5] for vaccine recipients vs 8·8% [7·1-10·7] for placebo recipients; p=0·40) are unlikely explanations for the increased rate of HIV-1 infections seen in vaccine recipients. Interpretation: The increased risk of HIV-1 acquisition in vaccine recipients, irrespective of number of doses received, warrants further investigation to understand the biological mechanism. We caution against further use of the Ad5 vector for HIV vaccines. Funding: National Institute of Allergy and Infectious Diseases, Merck, and South African Medical Research Council.