This study assessed the protective mechanism of astaxanthin (ASX) against ochratoxin A- (OTA-) induced cardiac injury in mice. Four groups of mice were established: control group (0.1 mL olive oil+0.1 mL NaHCO2), OTA group (0.1 mL OTA 5 mg/kg body weight), ASX group (0.1 mL ASX 100 mg/kg body weight), and ASX + OTA group (0.1 mL ASX 100 mg/kg body weight, 2 h later, 0.1 mL OTA 5 mg/kg body weight). The test period lasted for 27 days (7 days of dosing, 2 days of rest). Electrocardiogram, body weight, heart weight, tissue pathology, oxidative markers (malondialdehyde (MDA), superoxide dismutase (SOD), catalase (CAT), and glutathione (GSH)), biochemical markers (creatine kinase (CK), creatine kinase isoenzyme (CK-MB), and lactate dehydrogenase (LDH)), electron microscopy, TUNEL, and Western blot tests were used to examine the effects of OTA on myocardial injury and ASX detoxification. The results showed that OTA exposure significantly decreased both body weight and heart weight. OTA induced a decrease in heart rate in mice and decreased tissue concentrations of SOD, CAT, and GSH, while increasing serum concentrations of cardiac enzymes (CK, CK-MB, and LDH) and tissue MDA. ASX improved heart rate, cardiac enzymes, and antioxidant levels in mice. The results of tissue pathology and TUNEL assay showed that ASX protects against OTA-induced myocardial injury. In addition, Western blot results showed that the OTA group upregulated Keap1, Bax, Caspase3, and Caspase9, while it downregulated Nrf2, HO-1, and Bcl-2 protein expression. ASX played a protective role by changing the expression of Keap1, Nrf2, HO-1, Bax, Bcl-2, Caspase3, and Caspase9 proteins. These results indicate that the protective mechanism of ASX on the myocardium works through the Keap1-Nrf2 signaling pathway and mitochondria-mediated apoptosis pathway. This study provides a molecular rationale for the mechanism underlying OTA-induced myocardial injury and the protective effect of ASX on the myocardium.