Background One anastomosis gastric bypass (OAGB) is increasingly used in the treatment of morbid obesity. However, the efficacy and safety outcomes of this procedure remain debated. We report the results of a randomised trial (YOMEGA) comparing the outcomes of OAGB versus standard Roux-en-Y gastric bypass (RYGB). Methods This prospective, multicentre, randomised non-inferiority trial, was held in nine obesity centres in France. Patients were eligible for inclusion if their body-mass index (BMI) was 40 kg/m2 or higher, or 35 kg/m2 or higher with the presence of at least one comorbidity (type 2 diabetes, high blood pressure, obstructive sleep apnoea, dyslipidaemia, or arthritis), and were aged 18–65 years. Key exclusion criteria were a history of oesophagitis, Barrett's oesophagus, severe gastro-oesophageal reflux disease resistant to proton-pump inhibitors, and previous bariatric surgery. Participants were randomly assigned (1:1) to OAGB or RYGB, stratified by centre with blocks of variable size; the study was open-label, with no masking required. RYGB consisted of a 150 cm alimentary limb and a 50 cm biliary limb and OAGB of a single gastrojejunal anastomosis with a 200 cm biliopancreatic limb. The primary endpoint was percentage excess BMI loss at 2 years. The primary endpoint was assessed in the per-protocol population and safety was assessed in all randomised participants. This study is registered with ClinicalTrials.gov, number NCT02139813, and is now completed. Findings From May 13, 2014, to March 2, 2016, of 261 patients screened for eligibility, 253 (97%) were randomly assigned to OAGB (n=129) or RYGB (n=124). Five patients did not undergo their assigned surgery, and after undergoing their surgery 14 were excluded from the per-protocol analysis (seven due to pregnancy, two deaths, one withdrawal, and four revisions from OAGB to RYGB) In the per-protocol population (n=117 OAGB, n=117 RYGB), mean age was 43·5 years (SD 10·8), mean BMI was 43·9 kg/m2 (SD 5·6), 176 (75%) of 234 participants were female, and 58 (27%) of 211 with available data had type 2 diabetes. After 2 years, mean percentage excess BMI loss was −87·9% (SD 23·6) in the OAGB group and −85·8% (SD 23·1) in the RYGB group, confirming non-inferiority of OAGB (mean difference −3·3%, 95% CI −9·1 to 2·6). 66 serious adverse events associated with surgery were reported (24 in the RYGB group vs 42 in the OAGB group; p=0·042), of which nine (21·4%) in the OAGB group were nutritional complications versus none in the RYGB group (p=0·0034). Interpretation OAGB is not inferior to RYGB regarding weight loss and metabolic improvement at 2 years. Higher incidences of diarrhoea, steatorrhoea, and nutritional adverse events were observed with a 200 cm biliopancreatic limb OAGB, suggesting a malabsorptive effect. Funding French Ministry of Health.