Background: Ensuring that lung-protective ventilation is achieved at scale is challenging in perioperative practice. Fully automated ventilation may be more effective in delivering lung-protective ventilation. Here, we compared automated lung-protective ventilation with conventional ventilation after elective cardiac surgery in haemodynamically stable patients. Methods: In this single-centre investigator-led study, patients were randomly assigned at the end of cardiac surgery to receive either automated (adaptive support ventilation) or conventional ventilation. The primary endpoint was the proportion of postoperative ventilation time characterised by exposure to predefined optimal, acceptable, and critical (injurious) ventilatory parameters in the first three postoperative hours. Secondary outcomes included severe hypoxaemia (SpO2 <85%) and resumption of spontaneous breathing. Data are presented as mean (95% confidence intervals [CIs]). Results: We randomised 220 patients (30.4% females; age: 62–76 yr). Subjects randomised to automated ventilation (n=109) spent a 29.7% (95% CI: 22.1–37.4) higher mean proportion of postoperative ventilation time receiving optimal postoperative ventilation after surgery (P<0.001) compared with subjects receiving conventional postoperative ventilation (n=111). Automated ventilation also reduced the proportion of postoperative ventilation time that subjects were exposed to injurious ventilatory settings by 2.5% (95% CI: 1–4; P=0.003). Severe hypoxaemia was less likely in subjects randomised to automated ventilation (risk ratio: 0.26 [0.22–0.31]; P<0.01). Subjects resumed spontaneous breathing more rapidly when randomised to automated ventilation (hazard ratio: 1.38 [1.05–1.83]; P=0.03). Conclusions: Fully automated ventilation in haemodynamically stable patients after cardiac surgery optimised lung-protective ventilation during postoperative ventilation, with fewer episodes of severe hypoxaemia and an accelerated resumption of spontaneous breathing. Clinical trial registration: NCT03180203.