Background: Incisional hernia is a frequent long-term complication after abdominal surgery, with a prevalence greater than 30% in high-risk groups. The aim of the PRIMA trial was to evaluate the effectiveness of mesh reinforcement in high-risk patients, to prevent incisional hernia. Methods: We did a multicentre, double-blind, randomised controlled trial at 11 hospitals in Austria, Germany, and the Netherlands. We included patients aged 18 years or older who were undergoing elective midline laparotomy and had either an abdominal aortic aneurysm or a body-mass index (BMI) of 27 kg/m2 or higher. We randomly assigned participants using a computer-generated randomisation sequence to one of three treatment groups: primary suture; onlay mesh reinforcement; or sublay mesh reinforcement. The primary endpoint was incidence of incisional hernia during 2 years of follow-up, analysed by intention to treat. Adjusted odds ratios (ORs) were estimated by logistic regression. This trial is registered at ClinicalTrials.gov, number NCT00761475. Findings: Between March, 2009, and December, 2012, 498 patients were enrolled to the study, of whom 18 were excluded before randomisation. Therefore, we included 480 patients in the primary analysis: 107 were assigned primary suture only, 188 were allocated onlay mesh reinforcement, and 185 were assigned sublay mesh reinforcement. 92 patients were identified with an incisional hernia, 33 (30%) who were allocated primary suture only, 25 (13%) who were assigned onlay mesh reinforcement, and 34 (18%) who were assigned sublay mesh reinforcement (onlay mesh reinforcement vs primary suture, OR 0·37, 95% CI 0·20-0·69; p=0·0016; sublay mesh reinforcement vs primary suture, 0·55, 0·30-1·00; p=0·05). Seromas were more frequent in patients allocated onlay mesh reinforcement (34 of 188) than in those assigned primary suture (five of 107; p=0·002) or sublay mesh reinforcement (13 of 185; p=0·002). The incidence of wound infection did not differ between treatment groups (14 of 107 primary suture; 25 of 188 onlay mesh reinforcement; and 19 of 185 sublay mesh reinforcement). Interpretation: A significant reduction in incidence of incisional hernia was achieved with onlay mesh reinforcement compared with sublay mesh reinforcement and primary suture only. Onlay mesh reinforcement has the potential to become the standard treatment for high-risk patients undergoing midline laparotomy. Funding: Baxter; B Braun Surgical SA.