Mastitis comprises an inflammation of the mammary gland, which is almost always linked with bacterial infection. The treatment of mastitis concerns antimicrobial substances, but not very successful. On the other hand, anti-inflammatory therapy with Chinese traditional medicine becomes an effective way for treating mastitis. Magnolol is a polyphenolic binaphthalene compound extracted from the stem bark of Magnolia sp., which has been shown to exert a potential for anti-inflammatory activity. The purpose of this study was to investigate the protective effects of magnolol on inflammation in lipopolysaccharide (LPS)-induced mastitis mouse model in vivo and the mechanism of this protective effects in LPS-stimulated mouse mammary epithelial cells (MMECs) in vitro. The damage of tissues was determined by histopathology and myeloperoxidase (MPO) assay. The expression of pro-inflammatory cytokines was determined by enzyme-linked immunosorbent assay (ELISA). Nuclear factor-kappa B (NF-κB), inhibitory kappa B (IκBα) protein, p38, extracellular signal-regulated kinase (ERK), c-Jun N-terminal kinase (JNK), and Toll-like receptor 4 (TLR4) were determined by Western blot. The results showed that magnolol significantly inhibit the LPS-induced TNF-α, IL-6, and IL-1β production both in vivo and vitro. Magnolol declined the phosphorylation of IκBα, p65, p38, ERK, and JNK in LPS-stimulated MMECs. Furthermore, magnolol inhibited the expression of TLR4 in LPS-stimulated MMECs. In vivo study, it was also observed that magnolol attenuated the damage of mastitis tissues in the mouse models. These findings demonstrated that magnolol attenuate LPS-stimulated inflammatory response by suppressing TLR4/NF-κB/mitogen-activated protein kinase (MAPK) signaling system. Thereby, magnolol may be a therapeutic agent against mastitis.