Aims/hypothesisIn sub-Saharan Africa (SSA), 5% of adults are living with type 2 diabetes and this is rising sharply, with a greater increase among people with HIV. Evidence on the efficacy of prevention strategies in this cohort is scarce. We conducted a Phase II double-blind placebo-controlled trial that aimed to determine the impact of metformin on blood glucose levels among people with prediabetes (defined as impaired fasting glucose [IFG] and/or impaired glucose tolerance [IGT]) and HIV in SSA.MethodsAdults (≥18 years old) who were stable in HIV care and found to have prediabetes (IFG and/or IGT) and who were attending hospitals in Dar es Salaam, Tanzania, were randomised to receive sustained-release metformin, 2000 mg daily, or matching placebo between 4 November 2019 and 21 July 2020. Randomisation used permuted blocks. Allocation was concealed in the trial database and made visible only to the Chief Pharmacist after consent was taken. All participants, research and clinical staff remained blinded to the allocation. Participants were provided with information on diet and lifestyle and had access to various health information following the start of the coronavirus disease 2019 (COVID-19) pandemic. Participants were followed up for 12 months. The primary outcome measure was capillary blood glucose measured 2 h following a 75 g glucose load. Analyses were by intention-to-treat.ResultsIn total, 364 participants (182 in each arm) were randomised to the metformin or placebo group. At enrolment, in the metformin and placebo arms, mean fasting glucose was 6.37 mmol/l (95% CI 6.23, 6.50) and 6.26 mmol/l (95% CI 6.15, 6.36), respectively, and mean 2 h glucose levels following a 75 g oral glucose load were 8.39 mmol/l (95% CI 8.22, 8.56) and 8.24 mmol/l (95% CI 8.07, 8.41), respectively. At the final assessment at 12 months, 145/182 (79.7%) individuals randomised to metformin compared with 158/182 (86.8%) randomised to placebo indicated that they had taken >95% of their medicines in the previous 28 days (p=0.068). At this visit, in the metformin and placebo arms, mean fasting glucose levels were 6.17 mmol/l (95% CI 6.03, 6.30) and 6.30 mmol/l (95% CI 6.18, 6.42), respectively, and mean 2 h glucose levels following a 75 g oral glucose load were 7.88 mmol/l (95% CI 7.65, 8.12) and 7.71 mmol/l (95% CI 7.49, 7.94), respectively. Using a linear mixed model controlling for respective baseline values, the mean difference between the metformin and placebo group (metformin–placebo) was −0.08 mmol/l (95% CI −0.37, 0.20) for fasting glucose and 0.20 mmol/l (95% CI −0.17, 0.58) for glucose levels 2 h post a 75 g glucose load. Weight was significantly lower in the metformin arm than in the placebo arm: using the linear mixed model adjusting for baseline values, the mean difference in weight was −1.47 kg (95% CI −2.58, −0.35). In total, 16/182 (8.8%) individuals had a serious adverse event (Grade 3 or Grade 4 in the Division of Acquired Immunodeficiency Syndrome [DAIDS] adverse event grading table) or died in the metformin arm compared with 18/182 (9.9%) in the placebo arm; these events were either unrelated to or unlikely to be related to the study drugs.Conclusions/interpretationBlood glucose decreased over time in both the metformin and placebo arms during the trial but did not differ significantly between the arms at 12 months of follow up. Metformin therapy was found to be safe for use in individuals with HIV and prediabetes. A larger trial with longer follow up is needed to establish if metformin can be safely used for the prevention of diabetes in people who have HIV.Trial registrationThe trial is registered on the International Standard Randomised Controlled Trial Number (ISRCTN) registry (www.isrctn.com/), registration number: ISCRTN76157257.FundingThis research was funded by the National Institute for Health Research using UK aid from the UK Government to support global health research.Graphical