Acute lung injury (ALI) is a major cause of acute respiratory failure with a high morbidity and mortality rate, and effective therapeutic strategies for ALI remain limited. Inflammatory response is considered crucial for the pathogenesis of ALI. Garlic, a globally used cooking spice, reportedly exhibits excellent anti-inflammatory bioactivity. However, protective effects of garlic against ALI have never been reported. This study aimed to investigate the protective effects of garlic oil (GO) supplementation on lipopolysaccharide (LPS)-induced ALI models. Hematoxylin and eosin staining, pathology scores, lung myeloperoxidase (MPO) activity measurement, lung wet/dry (W/D) ratio detection, and bronchoalveolar lavage fluid (BALF) analysis were performed to investigate ALI histopathology. Real-time polymerase chain reaction, western blotting, and enzyme-linked immunosorbent assay were conducted to evaluate the expression levels of inflammatory factors, nuclear factor-κB (NF-κB), NLRP3, pyroptosis-related proteins, and H2S-producing enzymes. GO attenuated LPS-induced pulmonary pathological changes, lung W/D ratio, MPO activity, and inflammatory cytokines in the lungs and BALF. Additionally, GO suppressed LPS-induced NF-κB activation, NLRP3 inflammasome expression, and inflammatory-related pyroptosis. Mechanistically, GO promoted increased H2S production in lung tissues by enhancing the conversion of GO-rich polysulfide compounds or by increasing the expression of H2S-producing enzymes in vivo. Inhibition of endogenous or exogenous H2S production reversed the protective effects of GO on ALI and eliminated the inhibitory effects of GO on NF-κB, NLRP3, and pyroptotic signaling pathways. Overall, these findings indicate that GO has a critical anti-inflammatory effect and protects against LPS-induced ALI by suppressing the NF-κB/NLRP3 signaling pathway via H2S generation.