Ochratoxin A (OTA) is a common environmental pollutant found in a variety of foods and grains, and excessive OTA consumption causes serious global health effects on animals and humans. Astaxanthin (AST) is a natural carotenoid that has anti-inflammatory, antiapoptotic, immunomodulatory, antitumor, antidiabetes, and other biological activities. The present study is aimed at investigating the effects of AST on OTA-induced cecum injury and its mechanism of action. Eighty C57 mice were randomly divided into four groups, including the control group, OTA group (5 mg/kg body weight), AST group (100 mg/kg body weight), and AST intervention group (100 mg/kg body weight AST+5 mg/kg body weight OTA). It was found that AST decreased the endotoxin content, effectively prevented the shortening of mouse cecum villi, and increased the expression levels of tight junction (TJ) proteins, consisting of occludin, claudin-1, and zonula occludens-1 (ZO-1). AST increased the number of goblet cells, the contents of mucin-2 (MUC2), and defensins (Defa5 and β-pD2) significantly, while the expression of mucin-1 (MUC1) decreased significantly. The 16S rRNA sequencing showed that AST affected the richness and diversity of cecum flora, decreased the proportion of lactobacillus, and also decreased the contents of short-chain fatty acids (SCFAs) (acetate and butyrate). In addition, AST significantly decreased the expression of TLR4, MyD88, and p-p65, while increasing the expression of p65. Meanwhile, the expression of inflammatory factors including TNF-α and INF-γ decreased, while the expression of IL-10 increased. In conclusion, AST reduced OTA-induced cecum injury by regulating the cecum barrier function and TLR4/MyD88/NF-κB signaling pathway.