Objective Myocardial ischemia-reperfusion injury (MIRI) is the leading cause of death in patients with cardiovascular disease. The purpose of this study is to investigate the effect and mechanism of forkhead box C2 (FOXC2) on MIRI in rats. Methods We made ischemia-reperfusion (I/R) models for rats by performing I/R surgery. After 3 hours, 3 days, and 7 days of reperfusion, we detected the structure and function of rat myocardium by 2, 3, 5-triphenyl tetrazolium chloride staining, echocardiography, lactate dehydrogenase kit, and haematoxylin-eosin staining. The change of FOXC2 expression in myocardial tissue was also detected. Then, we increased the expression of FOXC2 in rats by adenovirus transfection to clarify the effect of FOXC2 on changes of oxidative stress and inflammation of rat myocardium. In addition, we detected the effect of FOXC2 overexpression plasmid on the function of H9c2 cells in vitro. The expression changes of Nrf2/HO-1 in myocardial cells were also detected to clarify the mechanism of action of FOXC2. Results The expression of FOXC2 in I/R rats was significantly lower than that in the sham group. After overexpressing FOXC2 in I/R rats, we found that the expression of SOD1/2 of rat myocardium and inflammatory factors in the serum were significantly reduced. Overexpression of FOXC2 also increased the viability and antioxidant capacity of H9c2 cells. In addition, FOXC2 was found to increase the activity of the Nrf2/HO-1 signaling pathway in myocardial cells, and the inhibition of Nrf2/HO-1 signaling pathway attenuated the protective effect of FOXC2 on myocardial cells. Conclusions MIRI in rats was accompanied by low expression of FOXC2 in myocardial tissue. Overexpression of FOXC2 reduces the level of inflammation and oxidative stress in myocardial tissue by promoting the Nrf2/HO-1 signaling pathway, thereby alleviating MIRI.