To explore the protective effect of methylene blue (MB) on myocardial injury in sepsis and its possible signaling pathway. A total of 32 female Wistar rats were randomly divided into sham operation group, sepsis model group, MB prevention group, and MB treatment group, with 8 rats in each group. The MB prevention group was injected with 15 mg/kg MB in the peritoneal cavity 6 hours before modeling; the other 3 groups were injected with 4 mL/kg saline in the peritoneal cavity. The sepsis model was established by cecal ligation puncture (CLP); the sham operation group was only subjected to an exploratory incision without ligation or puncture of the caecum. The MB treatment group was injected with 15 mg/kg MB in the peritoneal cavity 0.5 hours after modeling; the other 3 groups were injected with 4 mL/kg saline in the peritoneal cavity. Peripheral blood and myocardial tissue were collected from each group at 6 hours and 12 hours after modeling. Histological changes in the myocardial tissue were observed under the microscope; the levels of serum cardiac troponin I (cTnI), MB isoenzyme of creatine kinase (CK-MB), tumor necrosis factor-α (TNF-α), and interleukin-6 (IL-6) were detected by enzyme-linked immunosorbent assay (ELISA); and the expressions of inducible nitric oxide synthase (iNOS), light chain 3 (LC3), and p62 in the myocardial tissue were detected by Western blotting. Under light microscopy, no obvious abnormalities were found in the myocardium of the sham operation group; the myocardium of the sepsis model group showed obvious inflammatory changes; the myocardium of the MB prevention group showed mild inflammatory changes at 6 hours after modeling, severe inflammatory changes at 12 hours but less severe than the sepsis model group; the myocardium of the MB treatment group showed more obvious inflammatory changes at 6 hours after modeling but less severe than the MB prevention group at 12 hours after modeling, and the inflammatory changes at 12 hours after modeling were alleviated but more severe than the 6 hours after modeling in MB prevention group. Compared with the sham operation group, the levels of cTnI, CK-MB, TNF-α and IL-6 in the MB prevention group at 6 hours and 12 hours after modeling were not significantly changed; compared with the sepsis model group, the cTnI, CK-MB, TNF-α and IL-6 levels in the MB treatment group at 6 hours and 12 hours after modeling were significantly lower [cTnI (ng/L): 175.03±12.26, 411.24±21.20 vs. 677.79±43.95 at 6 hours of modeling, 159.52±6.44, 412.46±32.94 vs. 687.61±55.09 at 12 hours of modeling; CK-MB (ng/L): 8.38±0.49, 16.87±1.41 vs. 24.87±1.74 at 6 hours of modeling, 7.94±0.30, 16.66±2.03 vs. 25.02±7.29 at 12 hours of modeling; TNF-α (ng/L): 26.98±3.31, 46.95±3.74 vs. 112.60±6.64 at 6 hours of modeling, 31.31±5.83, 90.97±5.14 vs. 149.30±4.67 at 12 hours of modeling; IL-6 (ng/L): 40.86±4.48, 128.90±3.14 vs. 248.90±12.76 at 6 hours of modeling, 80.13±7.94, 190.40±9.56 vs. 288.90±6.01 at 12 hours of modeling; all P < 0.05]. Western blotting showed that compared with the sham operation group, the protein expressions of iNOS, LC3, and p62 in the sepsis model group were significantly higher at 6 hours and 12 hours after modeling; compared with the sepsis model group, the protein expressions of iNOS, LC3, and p62 in the MB treatment group and MB prevention group were significantly lower at 6 hours and 12 hours after modeling (iNOS/GAPDH: 0.38±0.04, 0.60±0.04 vs. 0.77±0.04 at 6 hours of modeling; 0.38±0.02, 0.66±0.04 vs. 0.79±0.05 at 12 hours of modeling; LC3/GAPDH: 0.13±0.07, 0.42±0.07 vs. 1.05±0.16 at 6 hours of modeling; 0.08±0.02, 0.25±0.03 vs. 0.48±0.09 at 12 hours of modeling; p62/GAPDH: 0.17±0.05, 0.44±0.10 vs. 1.19±0.07 at 6 hours of modeling; 0.07±0.00, 0.28±0.08 vs. 0.69±0.02 at 12 hours of modeling; all P < 0.05). MB can reduce myocardial oxidative stress by inhibiting iNOS expression and mitochondrial autophagy in septic rats, thereby alleviating myocardial damage in sepsis, and has protective effect on myocardial damage in sepsis.