Bovine mastitis is the most common disease in dairy cattle. Bacterial infections are the main cause of mastitis. Lipopolysaccharide (LPS), a major structural component of the cell wall of Escherichia coli, is a good inducer used to replicate inflammation models. 8‐Methoxypsoralen (8‐MOP), a formerly considered photosensitizing agent, has been used in immunotherapy. This study investigated the protective effects of 8‐MOP on LPS‐induced inflammatory injury in bovine mammary epithelial cells (BMECs). LPS treatment (50 μg/mL for 12 hr) caused a decrease in cell viability, morphological damage, and cell apoptosis. Pretreatment with 8‐MOP at concentrations of 25 and 50 μg/ml significantly attenuated LPS‐induced inflammation in BMECs. qRT‐PCR analysis revealed that the messenger RNA expression of inflammatory cytokines and chemokine (interleukin‐1β [IL‐1β], IL‐6, tumor necrosis factor‐α, and IL‐8) was suppressed by 8‐MOP in LPS‐stimulated BMECs. Western blot analysis showed that 8‐MOP could also reduce the protein levels of cyclooxygenase‐2 and promote the translocation of high‐mobility group box 1 from the nucleus to cytoplasm. Furthermore, the anti‐inflammatory property of 8‐MOP was mediated by inhibiting nuclear factor kappa‐light‐chain‐enhancer of activated B cells activation and STAT1 phosphorylation. Taken together, 8‐MOP could protect cells from inflammatory injury induced by LPS, and may be a potential agent against bovine mastitis.