BACKGROUND:Observational and laboratory studies suggest that some hormonal contraceptive methods, particularly intramuscular depot medroxyprogesterone acetate (DMPA-IM), might increase women's susceptibility to HIV acquisition. We aimed to compare DMPA-IM, a copper intrauterine device (IUD), and a levonorgestrel (LNG) implant among African women seeking effective contraception and living in areas of high HIV incidence. METHODS:We did a randomised, multicentre, open-label trial across 12 research sites in eSwatini, Kenya, South Africa, and Zambia. We included HIV-seronegative women aged 16-35 years who were seeking effective contraception, had no medical contraindications to the trial contraceptive methods, agreed to use the assigned method for 18 months, and reported not using injectable, intrauterine, or implantable contraception for the previous 6 months. Participants were randomly assigned (1:1:1) to receive an injection of 150 mg/mL DMPA-IM every 3 months, a copper IUD, or a LNG implant with random block sizes between 15 and 30, stratified by site. Participants were assigned using an online randomisation system, which was accessed for each randomisation by study staff at each site. The primary endpoint was incident HIV infection in the modified intention-to-treat population, including all randomised participants who were HIV negative at enrolment and who contributed at least one HIV test. The primary safety endpoint was any serious adverse event or any adverse event resulting in method discontinuation, until the trial exit visit at 18 months and was assessed in all enrolled and randomly assigned women. This study is registered with ClinicalTrials.gov, number NCT02550067. FINDINGS:Between Dec 14, 2015, and Sept 12, 2017, 7830 women were enrolled and 7829 were randomly assigned to the DMPA-IM group (n=2609), the copper IUD group (n=2607), or the LNG implant group (n=2613). 7715 (99%) participants were included in the modified intention-to-treat population (2556 in the DMPA-IM group, 2571 in the copper IUD group, and 2588 in the LNG implant group), and women used their assigned method for 9567 (92%) of 10 409 woman-years of follow-up time. 397 HIV infections occurred (incidence 3·81 per 100 woman-years [95% CI 3·45-4·21]): 143 (36%; 4·19 per 100 woman-years [3·54-4·94]) in the DMPA-IM group, 138 (35%: 3·94 per 100 woman-years [3·31-4·66]) in the copper IUD group, and 116 (29%; 3·31 per 100 woman-years [2·74-3·98]) in the LNG implant group. In the modified intention-to-treat analysis, the hazard ratios for HIV acquisition were 1·04 (96% CI 0·82-1·33, p=0·72) for DMPA-IM compared with copper IUD, 1·23 (0·95-1·59, p=0·097) for DMPA-IM compared with LNG implant, and 1·18 (0·91-1·53, p=0·19) for copper IUD compared with LNG implant. 12 women died during the study: six in the DMPA-IM group, five in the copper IUD group, and one in the LNG implant group. Serious adverse events occurred in 49 (2%) of 2609 participants in the DMPA-IM group, 92 (4%) of 2607 participants in the copper IUD group, and 78 (3%) of 2613 participants in the LNG implant group. Adverse events resulting in discontinuation of the randomly assigned method occurred in 109 (4%) women in the DMPA-IM group, 218 (8%) women in the copper IUD group, and 226 (9%) women in the LNG implant group (p<0·0001 for DMPA-IM vs copper IUD and for DMPA-IM vs LNG implant). 255 pregnancies occurred: 61 (24%) in the DMPA-IM group, 116 (45%) in the copper IUD group, and 78 (31%) in the LNG implant group. 181 (71%) pregnancies occurred after discontinuation of randomly assigned method. INTERPRETATION:We did not find a substantial difference in HIV risk among the methods evaluated, and all methods were safe and highly effective. HIV incidence was high in this population of women seeking pregnancy prevention, emphasising the need for integration of HIV prevention within contraceptive services for African women. These results support continued and increased access to these three contraceptive methods. FUNDING:Bill & Melinda Gates Foundation, US Agency for International Development and the President's Emergency Plan for AIDS Relief, Swedish International Development Cooperation Agency, South African Medical Research Council, and UN Population Fund. Contraceptive supplies were donated by the Government of South Africa and US Agency for International Development.