Trimetazidine is a piperazine-derived metabolic agent, which exerts cell protective effects and has been reported to be efficient in the treatment of chronic stable angina pectoris. In addition, it has been shown to exert protection against acute myocardial infarction. The present study aimed to investigate whether trimetazidine protects against cardiac ischemia/reperfusion (I/R) injury, and to determine whether its curative effects are associated with microRNA (miRNA)‑21 expression, Akt, and the B‑cell lymphoma 2 (Bcl‑2)/Bcl‑2‑associated X protein (Bax) pathway. Cardiac I/R injury was induced by ligating the left anterior descending coronary artery in adult rats. Subsequently, cardiac function was evaluated, and the expression levels of miRNA‑21, Bcl‑2, Bax and phosphorylated‑Akt were detected using quantitative polymerase chain reaction and western blotting. The results indicated that trimetazidine was able to significantly protect cardiac function and reduce infarct size in rats following cardiac I/R injury. Furthermore, trimetazidine significantly promoted miRNA‑21 expression and phosphorylated‑Akt protein expression, and reduced the Bcl‑2/Bax ratio in rats following cardiac I/R injury. Knockdown of miRNA‑21 using anti‑miR‑21 plasmids was able to reverse the protective effects of trimetazidine against cardiac I/R injury. These results indicated that miRNA‑21 serves a protective role in cardiac I/R injury via Akt and the Bcl‑2/Bax pathway. In addition, trimetazidine exerts protective effects against cardiac I/R injury through cardiac miRNA‑21 expression, Akt, and the Bcl‑2/Bax pathway. Therefore, the present study provided evidence regarding the protective effects of miRNA‑21 on cardiac I/R injury following treatment with trimetazidine in vivo.