Perioperative corticosteroid use may reduce acute kidney injury. We sought to test whether methylprednisolone reduces the risk of acute kidney injury after cardiac surgery. We conducted a prespecified substudy of a randomized controlled trial involving patients undergoing cardiac surgery with cardiopulmonary bypass (2007-2014); patients were recruited from 79 centres in 18 countries. Eligibility criteria included a moderate-to-high risk of perioperative death based on a preoperative score of 6 or greater on the European System for Cardiac Operative Risk Evaluation I. Patients (n = 7286) were randomly assigned (1:1) to receive intravenous methylprednisolone (250 mg at anesthetic induction and 250 mg at initiation of cardiopulmonary bypass) or placebo. Patients, caregivers, data collectors and outcome adjudicators were unaware of the assigned intervention. The primary outcome was postoperative acute kidney injury, defined as an increase in the serum creatinine concentration (from the preoperative value) of 0.3 mg/dL or greater (≥ 26.5 μmol/L) or 50% or greater in the 14-day period after surgery, or use of dialysis within 30 days after surgery. Acute kidney injury occurred in 1479/3647 patients (40.6%) in the methylprednisolone group and in 1426/3639 patients (39.2%) in the placebo group (adjusted relative risk 1.04, 95% confidence interval 0.96 to 1.11). Results were consistent across several definitions of acute kidney injury and in patients with preoperative chronic kidney disease. Intraoperative corticosteroid use did not reduce the risk of acute kidney injury in patients with a moderate-to-high risk of perioperative death who had cardiac surgery with cardiopulmonary bypass. Our results do not support the prophylactic use of steroids during cardiopulmonary bypass surgery. Trial registration: ClinicalTrials.gov, no. NCT00427388.