Background: Respiratory complications are an important cause of postoperative morbidity. We aimed to investigate whether continuous positive airway pressure (CPAP) administered immediately after major abdominal surgery could prevent postoperative morbidity. Methods: PRISM was an open-label, randomised, phase 3 trial done at 70 hospitals across six countries. Patients aged 50 years or older who were undergoing elective major open abdominal surgery were randomly assigned (1:1) to receive CPAP within 4 h of the end of surgery or usual postoperative care. Patients were randomly assigned using a computer-generated minimisation algorithm with inbuilt concealment. The primary outcome was a composite of pneumonia, endotracheal re-intubation, or death within 30 days after randomisation, assessed in the intention-to-treat population. Safety was assessed in all patients who received CPAP. The trial is registered with the ISRCTN registry, ISRCTN56012545. Findings: Between Feb 8, 2016, and Nov 11, 2019, 4806 patients were randomly assigned (2405 to the CPAP group and 2401 to the usual care group), of whom 4793 were included in the primary analysis (2396 in the CPAP group and 2397 in the usual care group). 195 (8·1%) of 2396 patients in the CPAP group and 197 (8·2%) of 2397 patients in the usual care group met the composite primary outcome (adjusted odds ratio 1·01 [95% CI 0·81–1·24]; p=0·95). 200 (8·9%) of 2241 patients in the CPAP group had adverse events. The most common adverse events were claustrophobia (78 [3·5%] of 2241 patients), oronasal dryness (43 [1·9%]), excessive air leak (36 [1·6%]), vomiting (26 [1·2%]), and pain (24 [1·1%]). There were two serious adverse events: one patient had significant hearing loss and one patient had obstruction of their venous catheter caused by a CPAP hood, which resulted in transient haemodynamic instability. Interpretation: In this large clinical effectiveness trial, CPAP did not reduce the incidence of pneumonia, endotracheal re-intubation, or death after major abdominal surgery. Although CPAP has an important role in the treatment of respiratory failure after surgery, routine use of prophylactic post-operative CPAP is not recommended. Funding: National Institute for Health Research, Barts Charity, Intersurgical, Association of Anaesthetists, and Sapienza Università di Roma.