Mastitis is a major inflammatory response of the mammary gland due to various pathogenic invasions and is a serious disease that affects the production yield and health status of cows. Astaxanthin (AST), a xanthophyll carotenoid, is a secondary metabolite synthesized by microalgae and yeasts that has been reported to suppress various inflammatory responses. However, the protective effect of AST on lipopolysaccharide (LPS)‐induced mammary epithelial cells has not yet been reported. The present study results indicated that AST treatment markedly attenuated the oxidative stress markers and nitric oxide (NO) while improving the anti‐oxidant enzymes in LPS exposed cells. On the other hand, LPS‐exposed cells showed nuclear translocation of nuclear factor‐κB (NF‐κB) with the activation of inflammatory cytokines such as monocyte chemoattractant protein‐1, tumor necrosis factor‐α, interferon‐γ, and interleukin‐6 (IL‐6). In addition, mRNA expression analysis revealed that the histone deacetylase (HDAC) ‐1, ‐2, ‐3, ‐6, ‐7 and pentraxin 3 (PTX3) expressions were increased in the LPS group. Furthermore, the activity of HDAC was increased to 2‐fold with a significant reduction in the histone acetyltransferase activity in cells exposed to LPS. However, AST was able to inhibit the nuclear translocation of NF‐κB with attenuated HDAC activity. Intriguingly, HDAC inhibition studies demonstrated that the cytokines such as IL‐4, IL‐8, granulocyte‐mcrophage colony stimulating factor, C‐reactive protein, IL‐17A, and IL‐22 were significantly suppressed which were upregulated in LPS treatment; while AST was found acting by improving the anti‐inflammatory cytokine IL‐10, and thioredoxin reductase levels. Collectively, these findings provide novel insights into the role of HDACs in regulating cellular processes involved in the pathogenesis of LPS‐induced mastitis as well as the potential use of AST as a therapeutic in treatment for controlling disease progression.