At present, the incidence of acute myocardial infarction is increasing year by year, and it has become one of the diseases with the highest mortality rate in humans. Myocardial ischemia-reperfusion injury (MIRI) is a major problem in the treatment of myocardial infarction, but clinically there is no effective way to treat MIRI. This study used Cystatin C (Cys C) to treat cardiomyocytes and rats to investigate the effect of Cys C on MIRI. We used H2O2 to induce rat cardiomyocytes (H9c2 cells) injury and stimulated the cells with Cys C. Cell counting kit 8 (CCK8) assay was used to determine the optimal concentration of H2O2 and Cys C to stimulate H9c2 cells. We determined the effects of Cys C on oxidative stress and apoptosis levels in H9c2 cells by measuring the activity of dehydrogenase (LDH), superoxide dismutase (SOD) and malondialdehyde (MDA), and the expression of apoptosis-related molecules (caspase3/8/9, Bax and Bcl-2). Changes in the activity of the NF-κB signaling pathway in H9c2 cells were also detected. In addition, we made rat MIRI models by ligating the coronary arteries and used Cys C to treat rats to verify the effect of Cys C on MIRI. According to the results of the CCK8 assay, 1000 μM of H2O2 and 15 μM of Cys C were used to stimulate H9c2 cells. Cys C alleviated H2O2-induced H9c2 cell injury, manifested as a decrease in LDH and MDA activity and an increase in SOD activity. Cys C also reduced the apoptosis level in H9c2 cells. The activity of NF-κB signaling pathway in injured H9c2 cells was increased, and stimulation of Cys C could inhibit the NF-κB signaling pathway in H9c2 cells. The application of Cys C in MIRI rats also verified its therapeutic effect on MIRI. Cys C reduced the oxidative stress and apoptosis levels of cardiomyocytes by inhibiting the activity of NF-κB signaling pathway in cardiomyocytes, thereby reducing cardiomyocyte injury and treating MIRI.