Inflammation and oxidative stress are implicated in the development of neurodegenerative diseases. Osthole is a compound that is extracted from She Chuang Zi, which is a type of traditional Chinese medicine. Osthole has previously been demonstrated to exhibit anticancer activities and has a low toxicity. However, to the best of our knowledge, the anti‑inflammatory effects of osthole in microglial cells have not been investigated extensively. The aim of the present study was to investigate the potential protective effects of osthole against inflammation induced by lipopolysaccharide (LPS) in microglial cells. The present study employed LPS‑stimulated BV2 mouse microglia to establish an inflammatory cell model and to investigate the anti‑inflammatory effects of osthole. Cells were pretreated with osthole for 1 h prior to LPS (10 µg/ml) stimulation. At 6 h after the addition of LPS, alterations in the levels of inflammatory factors, including tumor necrosis factor (TNF)‑α, interleukin (IL)‑6 and IL‑1β, were determined by ELISA. Furthermore, at 24 h after the addition of LPS, western blot analysis was performed to analyze the alterations in the protein expression of nuclear factor‑κB (NF‑κB) p65, phosphorylated‑NF‑κB p65, nuclear factor erythroid 2‑related factor 2 (Nrf2) and heme oxygenase (HO)‑1. The results demonstrated that the secretion of the inflammatory cytokines TNF‑α, IL‑6 and IL‑1β by LPS‑stimulated BV2 cells was significantly reduced by osthole treatment. Simultaneously, osthole treatment inhibited the LPS‑induced activation of the NF‑κB signaling pathway. In addition, osthole upregulated the expression of Nrf2 and HO‑1 in a dose‑dependent manner. Based on these results, osthole may exhibit anti‑inflammatory effects via the NF‑κB and Nrf2 pathways, indicating that osthole has the potential to be developed into an effective anti-inflammatory drug.