The role of pterostilbene (Pte) in inflammation induced by ischemia/reperfusion is not well understood. The aim of this study was to investigate whether Pte modulates neutrophil accumulation and the induction of tumor necrosis factor-α (TNF‑α) in an ischemia/reperfusion (I/R)‑injured rat heart model. Rats were randomly exposed to a sham operation, myocardial ischemia/reperfusion (MI/R) alone, MI/R+Pte, MI/R+Pte+L‑NAME and MI/R+Pte+ (methylene blue) MB. The results demonstrated that compared with MI/R, Pte reduced the area of myocardial infarction, the levels of myocardial myeloperoxidase, serum creatinine kinase and lactate dehydrogenase, and the production of serum and myocardial TNF‑α. These Pte‑induced effects were eliminated by the administration of L‑NAME, a nitric oxide (NO) synthase inhibitor, and MB, a cyclic guanosine monophosphate (cGMP) inhibitor. In conclusion, Pte produces cardioprotective and anti‑inflammatory effects. These effects may be associated with an increase in NO production, the inhibition of neutrophil accumulation, and induction of TNF‑α and cGMP signaling pathways in myocardium subjected to MI/R.