Studies have shown that histone H3 at lysine9 (H3K9me2) is an important epigenetic modifier of embryonic development, cell reprogramming and cell differentiation, but its specific role in cardiomyocyte formation remains to be elucidated. The present study established a model of 5‑Azacytidine‑induced differentiation of rat bone mesenchymal stem cells (MSCs) into cardiomyocytes and, on this basis, investigated the dimethylation of H3K9me2 and its effect on cardiomyocyte formation by knockdown of H3K9me2 methylase, euchromatic histone‑lysine N‑methyltransferase 2 (G9a) and H3K9me2 lysine demethylase 3A (KDM3A). The results demonstrated that, in comparison with the normal induction process, the knockdown of G9a could significantly reduce the H3K9me2 level of the MSCs in the induced model. Reverse transcription‑quantitative (RT‑q) PCR demonstrated that the expression of cardiac troponin T(cTnT) was significantly increased. In addition, flow cytometry demonstrated that the proportion of cTnT‑positive cells was significantly increased on day21. With the knockdown of KDM3A, the opposite occurred. In order to explore the specific way of H3K9me2 regulating cardiomyocyte formation, western blotting and RT‑qPCR were used to detect the expression of key transcription factors including GATA binding protein4 (GATA‑4), NK2 Homeobox 5 (Nkx2.5) and myocyte enhancer factor2c(MEF2c) during cardiomyocyte formation. The decrease of H3K9me2 increased the expression of transcription factors GATA‑4, Nkx2.5 and MEF2c in the early stage of myocardial development while the increase of H3K9me2 inhibited the expression of those transcription factors. Accordingly, it was concluded that H3K9me2 is a negative regulator of cardiomyocyte formation and can participate in cardiomyocyte formation by activating or inhibiting key transcription factors of cardiomyocytes, which will lay the foundation for the optimized induction efficiency of cardiomyocytes in invitro and clinical applications.