To investigate the effect of miR-181a targeting XIAP gene on the apoptosis of cardiomyocytes induced by hypoxia/reoxygenation (H/R) and its mechanism. The primary cultured cardiomyocytes were treated with hypoxia for 3 hours and reoxygenation for 4 hours to construct H/R cell model. The expression of miR-181a and XIAP messenger RNA in cardiomyocytes was detected by reverse-transcription polymerase chain reaction, and the expression of XIAP protein in cardiomyocytes was detected by Western blot analysis. H/R cardiomyocytes with low expression of miR-181a and overexpression of XIAP were constructed, and the effects of low expression of miR-181a and upregulation of XIAP on cardiomyocyte apoptosis were detected by flow cytometry. A dual luciferase reporter assay was used to detect the target relationship between miR-181a and XIAP. Further, H/R myocardial cells with low XIAP expression were constructed to observe the effect of downregulation of XIAP expression on apoptosis of myocardial cells with low expression of microarray-181a. The expression of apoptosis-related proteins Bax and Bcl-2 in myocardial cells was detected by Western blot analysis. After H/R treatment, the expression of microRNAs-181a was high but that of XIAP was low. The apoptosis of cardiomyocytes could be inhibited by both the low expression of miR-181a and the upregulation of XIAP. The results of dual luciferase reporter gene showed that XIAP was a potential target gene for miR-181a. The inhibitory effect of low expression of miR-181a on myocardial apoptosis could be reversed and the inhibitory effect of low expression of miR-181a on Bax protein expression and the promotion of Bcl-2 protein expression could be reversed by the downregulation of XIAP. MiR-181a can inhibit the apoptosis of hypoxic-reoxygenated cardiomyocytes by targeting XIAP to downregulate Bax and upregulate Bcl expression.