Background Roux-en-Y gastric bypass is recognised as a standard of care in the treatment of diabetes mellitus and obesity. However, the optimal length of the Roux-en-Y gastric bypass limbs remains controversial, with substantial variation in practice. Specifically, a longer biliopancreatic limb length of 150 cm (‘long limb’) has been hypothesised to be better for the treatment of diabetes mellitus because it increases the postprandial secretion of gut hormones, such as glucagon-like peptide 1, and increases insulin sensitivity, compared with the Roux-en-Y gastric bypass utilising a standard biliopancreatic limb length of 50 cm (‘standard limb’). Objective To evaluate the mechanisms, clinical efficacy and safety of long limb versus the standard limb Roux-en-Y gastric bypass in patients undergoing metabolic surgery for obesity and diabetes mellitus. Design A double-blind, mechanistic randomised controlled trial was conducted to evaluate the mechanisms, clinical efficacy and safety of the two interventions. Setting Imperial College London, King’s College London and their associated NHS trusts. Participants Patients with obesity and type 2 diabetes mellitus who were eligible for metabolic surgery. Interventions Participants were randomly assigned (1 : 1) to 150-cm (long limb) or 50-cm (standard limb) biliopancreatic limb Roux-en-Y gastric bypass with a fixed alimentary limb of 100 cm. The participants underwent meal tolerance tests to measure glucose excursions, glucagon-like peptide 1 and insulin secretion, and hyperinsulinaemic–euglycaemic clamps with stable isotopes to measure insulin sensitivity preoperatively, at 2 weeks after the surgery and at matched 20% total body weight loss. Clinical follow-up continued up to 1 year. Main outcome measures Primary – postprandial peak of active glucagon-like peptide 1 concentration at 2 weeks after intervention. Secondary – fasting and postprandial glucose and insulin concentrations, insulin sensitivity, glycaemic control and weight loss at 12 months after surgery, and safety of participants. Results Of the 53 participants randomised, 48 completed the trial. There were statistically significant decreases in fasting and postprandial glucose concentrations, increases in insulin, glucagon-like peptide 1 secretion and insulin sensitivity, and reductions in the levels of glycated haemoglobin (i.e. HbA1c) and weight in both long and standard limb groups. However, there were no significant differences between trial groups in any of these parameters. Limitations The main limitations of this trial include the relatively short follow-up of 12 months and elongation of the biliopancreatic limb to a fixed length of 150 cm. Conclusion Patients undergoing both types of Roux-en-Y gastric bypass benefited metabolically from the surgery. The results have not demonstrated that elongation of the biliopancreatic limb of the Roux-en-Y gastric bypass from 50 to 150 cm results in superior metabolic outcomes in terms of glucose excursions, insulin and incretin hormone secretion, and insulin sensitivity, when assessed at up to 12 months after surgery. Future work Continued longitudinal follow-up of the long and standard limb cohorts will be necessary to evaluate any differential effects of the two surgical procedures on patients’ metabolic trajectories. Trial registration Current Controlled Trials ISRCTN15283219. Funding This project was funded by the Efficacy and Mechanism Evaluation programme, a Medical Research Council and National Institute for Health Research (NIHR) partnership. This will be published in full in Efficacy and Mechanism Evaluation; Vol. 8, No. 3. See the NIHR Journals Library website for further project information. The section in the report on endocrinology and investigative medicine is funded by grants from the Medical Research Council, the Biotechnology and Biological Sciences Research Council, NIHR, an Integrative Mammalian Biology Capacity Building Award and a FP7-HEALTH-2009-241592 EuroCHIP grant. This section is also supported by the NIHR Biomedical Research Centre Funding Scheme.