Background: The MRKAd5 HIV-1 gag/pol/nef subtype B vaccine was designed to elicit T-cell-mediated immune responses capable of providing complete or partial protection from HIV-1 infection or a decrease in viral load after acquisition. We aim to assess the safety and efficacy of the vaccine in South Africa, where the major circulating clade is subtype C. Methods: We did a phase 2b double-blind, randomised test-of-concept study in sexually active HIV-1 seronegative participants at five sites in South Africa. Randomisation was by a computer-generated random number sequence. The vaccine and placebo were given by intramuscular injection on a 0, 1, 6 month schedule. Our coprimary endpoints were a vaccine-induced reduction in HIV-1 acquisition and viral-load setpoint. These endpoints were assessed independently in the modified intention-to-treat (MITT) cohort with two-tailed significance tests stratified by sex. We assessed immunogenicity by interferon-γ ELISPOT in peripheral-blood mononuclear cells. After the lack of efficacy of the MRKAd5 HIV-1 vaccine in the Step study, enrolment and vaccination in our study was halted, treatment allocations were unmasked, and follow-up continued. This study is registered with the South Africa National Health Research Database, number DOH-27-0207-1539, and ClinicalTrials.gov, number NCT00413725. Findings: 801 of a scheduled 3000 participants, of whom 360 (45%) were women, were randomly assigned to receive either vaccine or placebo. 445 participants (56%) had adenovirus serotype 5 (Ad5) titres greater than 200, and 129 men (29%) were circumcised. 34 MITT participants in the vaccine group were diagnosed with HIV-1 (incidence rate 4·54 per 100 person-years) and 28 in the placebo group (3·70 per 100 person-years). There was no evidence of vaccine efficacy; the hazard ratio adjusted for sex was 1·25 (95% CI 0·76-2·05). Vaccine efficacy did not differ by Ad5 titre, sex, age, herpes simplex virus type 2 status, or circumcision. The geometric mean viral-load setpoint was 20 483 copies per mL (n=33) in the vaccine group and 34 032 copies per mL (n=28) in the placebo group (p=0·39). The vaccine elicited interferon-γ-secreting T cells that recognised both clade B (89%) and C (77%) antigens. Interpretation: The MRKAd5 HIV-1 vaccine did not prevent HIV-1 infection or lower viral-load setpoint; however, stopping our trial early probably compromised our ability to draw conclusions. The high incidence rates noted in South Africa highlight the crucial need for intensified efforts to develop an efficacious vaccine. Funding: The US National Institute of Allergy and Infectious Disease and Merck and Co Inc.