Ischemia/reperfusion (I/R) injury is a life-threatening vascular emergency following myocardial infarction. Our previous study showed cardioprotective effects of metformin against myocardial I/R injury. In this study, we further examined the involvement of AMPK mediated activation of NLRP3 inflammasome in this cardioprotective effect of metformin. Myocardial I/R injury was simulated in a rat heart Langendorff model and neonatal rat ventricle myocytes (NRVMs) were subjected to hypoxi/reoxygenation (H/R) to establish an in vitro model. Outcome measures included myocardial infarct size, hemodynamic monitoring, myocardial tissue injury, myocardial apoptotic index and the inflammatory response. myocardial infarct size and cardiac enzyme activities. First, we found that metformin postconditioning can not only significantly alleviated myocardial infarct size, attenuated cell apoptosis, and inhibited myocardial fibrosis. Furthermore, metformin activated phosphorylated AMPK, decreased pro-inflammatory cytokines, TNF-α, IL-6 and IL-1β, and decreased NLRP3 inflammasome activation. In isolated NRVMs metformin increased cellular viability, decreased LDH activity and inhibited cellular apoptosis and inflammation. Importantly, inhibition of AMPK phosphorylation by Compound C (CC) resulted in decreased survival of cardiomyocytes mainly by inducing the release of inflammatory cytokines and increasing NLRP3 inflammasome activation. Finally, in vitro studies revealed that the NLRP3 activator nigericin abolished the anti-inflammatory effects of metformin in NRVMs, but it had little effect on AMPK phosphorylation. Collectively, our study confirmed that metformin exerts cardioprotective effects by regulating myocardial I/R injury-induced inflammatory response, which was largely dependent on the enhancement of the AMPK pathway, thereby suppressing NLRP3 inflammasome activation.