Background: Exogenous melatonin exerts a similar effect to protective ventilation on attenuating ventilator-induced lung injury (VILI) by inhibiting NLRP3 inflammasome activation in mouse model. However, the effect of protective ventilation on the production of endogenous melatonin and prognosis in patients undergoing esophageal cancer surgery remains unknown. In this study, we aimed to reveal the effects of protective ventilation on the production of endogenous melatonin, interleukin (IL)-1β, IL-18 and major complications in patients undergoing esophageal cancer surgery. Methods: Eight-eight patients were randomized to receive “conventional” ventilation (Vt=10 mL/kg) or lung protective ventilation [Vt=5 mL/kg along with 5 cm of H2O positive end-expiratory pressure (PEEP)]. IL-1β, IL-18 and melatonin levels in bronchoalveolar lavage fluid (BALF) and serum were measured. Respiratory variables and outcomes were evaluated.Results: Lung protective ventilation decreased the peak airway pressure (Ppeak), plateau airway pressure (Pplat) and driving pressure (ΔP) compared with the “conventional” ventilation group. Lung protective ventilation inhibited polymorphonuclear (PMN) cells invasion into the BALF (P=0.000). Likewise, lung protective ventilation suppressed alveolar and serum IL-1β and IL-18 secretion after mechanical ventilation. Furthermore, lung protective ventilation resulted in a decrease in the inhibition of endogenous MT production compared to “conventional” ventilation (P=0.000). In addition, lung protective ventilation reduced the incidence of postoperative pulmonary complications (P=0.04) and the rate of major postoperative complications (P=0.023).Conclusions: Taken together, lung protective ventilation for esophageal cancer surgery suppressed the secretion of IL-1β, IL-18 and restored the endogenous melatonin level. Meanwhile, lung protective ventilation improved postoperative outcomes after esophageal cancer surgery.Trial registration: The Chinese Clinical Trial Registry, ChiCTR1900026190. Registered 25 September 2019, http://www.chictr.org.cn/edit.aspx?pid=34677&htm=4