Background The abnormality of the immune system caused by infection is a contributor to the organ dysfunctions associated with sepsis. The balance between Th17/Treg cells is essential for maintaining immune homeostasis. Bergapten is a natural furocoumarin and has been reported to alleviate the Th17/Treg imbalance. Here, we explored the effects of bergapten on the inflammation and immune state in mouse models of sepsis. Methods The model was established using the cecal ligation and puncture method. Mice were administered 30 mg/kg bergapten. Histological examination, RT-qPCR, enzyme-linked immunosorbent assay, immunoblotting, immunofluorescence, immunohistochemistry, and flow cytometry were used to evaluate the effects of bergapten in vivo. Results Bergapten ameliorated lung damage, reduced lung wet/dry weight ratio, inhibited myeloperoxidase activity, and reduced inflammatory cell infiltration. Bergapten also restrained sepsis-induced inflammation via inhibition of inflammatory cytokines and NF-κB signaling. These effects were accompanied by the restored Th17/Treg balance induced by bergapten. Bergapten decreased the number of Th17 cells and elevated the number of Tregs, and this effect was mediated by the signal transducer and activator of transcription 5 (STAT5)/Forkhead box P3 (Foxp3) and STAT3/retinoid-related orphan receptor-γt (RORγt) pathways. Conclusions Bergapten exerted anti-inflammatory effects in acute lung injury by improving the Th17/Treg balance, which suggested a potential of bergapten as an immunomodulatory drug treating sepsis-associated diseases.