Melatonin ameliorates BPD by modulating the gut microbiota-SCFA metabolic axis, which in turn suppresses NF-κB pathway activation and pyroptosis in lung tissues via systemic circulation. This finding suggests a novel therapeutic strategy for the treatment of BPD.