Myocardial ischemia/reperfusion (I/R) induces cardiac cell injury; however, the mechanism underlying cardiac damage remains unclear. A previous study demonstrated that triptolide (TP) exerts protective effects against I/R in cerebral cells. The present study aimed to evaluate the protective effects of TP on cardiac cells, and investigated the potential mechanisms involved in I/R‑induced damage. Rats and cardiac H9C2 cells undergoing I/R were pretreated with TP, and cell damage was assessed in vivo and in vitro. Hematoxylin and eosin and terminal deoxynucleotidyl‑transferase‑mediated dUTP nick end labeling staining were employed to evaluate I/R injury in rat cardiac tissue. Inflammatory factors, including tumor necrosis factor‑α, interleukin (IL)‑1β and IL‑6, were detected by ELISA. Biochemical analyses were performed to evaluate the bioactivity of superoxide dismutase, malondialdehyde and catalase. In addition, viability of H9C2 cells was measured using the Cell Counting kit 8 assay. Flow cytometry was used to evaluate cell apoptosis and reactive oxygen species (ROS) generation. Furthermore, the expression levels of proteins associated with apoptosis, peroxide and inflammation were measured using western blot analysis. H9C2 cells were also treated with N‑acetylcysteine and pyrrolidine dithiocarbamate, and cell injury was assessed after peroxidation or I/R. The results demonstrated that TP exerted a significant protective effect on cardiac cells in vivo and in vitro. TP reduced the inflammatory response, as determined by nuclear factor‑κB inhibition. In addition, TP decreased ROS‑mediated lipid peroxidation, and reduced ROS generation. TP also inhibited cell apoptosis by activating the extracellular signal‑regulated kinase 1/2 pathway. In conclusion, TP may protect cardiac cells from I/R injury; the potential protective mechanisms of TP against I/R include anti‑inflammatory action, antioxidation and apoptotic resistance.