Diabetes mellitus (DM) increases myocardial oxidative stress and endoplasmic reticulum (ER) stress. Melatonin confers cardioprotective effect by suppressing oxidative damage. However, the effect and mechanism of melatonin on myocardial ischemia-reperfusion (MI/R) injury in type 2 diabetic state are still unknown. In this study, we developed high-fat diet-fed streptozotocin (HFD-STZ) rat, a well-known type 2 diabetic model, to evaluate the effect of melatonin on MI/R injury with a focus on silent information regulator 1 (SIRT1) signaling, oxidative stress, and PERK/eIF2α/ATF4-mediated ER stress. HFD-STZ treated rats were exposed to melatonin treatment in the presence or the absence of sirtinol (a SIRT1 inhibitor) and subjected to MI/R surgery. Compared with nondiabetic animals, type 2 diabetic rats exhibited significantly decreased myocardial SIRT1 signaling, increased apoptosis, enhanced oxidative stress, and ER stress. Additionally, further reduced SIRT1 signaling, aggravated oxidative damage, and ER stress were found in diabetic animals subjected to MI/R surgery. Melatonin markedly reduced MI/R injury by improving cardiac functional recovery and decreasing myocardial apoptosis in type 2 diabetic animals. Melatonin treatment up-regulated SIRT1 expression, reduced oxidative damage, and suppressed PERK/eIF2α/ATF4 signaling. However, these effects were all attenuated by SIRT1 inhibition. Melatonin also protected high glucose/high fat cultured H9C2 cardiomyocytes against simulated ischemia-reperfusion injury-induced ER stress by activating SIRT1 signaling while SIRT1 siRNA blunted this action. Taken together, our study demonstrates that reduced cardiac SIRT1 signaling in type 2 diabetic state aggravates MI/R injury. Melatonin ameliorates reperfusion-induced oxidative stress and ER stress via activation of SIRT1 signaling, thus reducing MI/R damage and improving cardiac function.