Melatonin can protect against cardiac ischemia/reperfusion (I/R) injury in models in vitro and in vivo by regulating oxidative stress and apoptosis; however, the precise molecular mechanisms involved remain unclear. Nuclear factor erythroid 2‑related factor 2 (Nrf2) is a transcription factor, which has been associated with the regulation of oxidative stress by translocating to the nucleus. Therefore, the present study investigated whether activation of the Nrf2 signaling pathway may be responsible for the protective effects of melatonin on I/R‑injured cardiomyocytes. In the present study, H9c2 cells were subjected to simulated I/R (SIR) injury and pretreated with melatonin and/or Nrf2 small interfering RNA (siRNA). Cell viability was detected via Cell Counting kit‑8 assay, apoptosis was examined by caspase‑3 cleavage and activity analysis; oxidative stress levels were determined by specific activity analysis assays. In the present study, it was observed that SIR induced significant increases in apoptosis and oxidative stress, and enhanced Nrf2 expression within H9c2 cells. Pretreatment with melatonin partially reversed these alterations and promoted Nrf2 nuclear translocation. Transfection with Nrf2 siRNA inhibited the protective effects of melatonin on SIR‑induced H9c2 cells. These results indicated that melatonin may protect H9c2 cells against I/R injury by reducing apoptosis and oxidative stress; this effect may be mediated via activation of the Nrf2 signaling pathway. Collectively, the results of the present study may suggest melatonin as a potential therapeutic agent against cardiac I/R injury.