The incidence of complications and mortality following open-heart surgery with cardiopulmonary bypass (CPB) is associated with the severity of the myocardial injury that occurs during surgery. Hydrogen-rich solution (HRS) may prevent antioxidant stress and inhibit apoptosis and inflammation. The present study was designed to investigate the effects of HRS on CPB-induced myocardial injury, and to investigate its potential regulation of the Janus-activated kinase 2/signal transducer and activator of transcription 3 (JAK2/STAT3) pathway. The HRS treatment resulted in the significant upregulation of malonyl dialdehyde (MDA) and myeloperoxidase (MPO), whilesuperoxide dismutase (SOD) levels were significantly downregulated, compared with the Sham group (P<0.05). Additionally, HRS treatment improved myocardial injury, and decreased the expression levels of cardiac troponins, heart-type fatty acid binding protein, interleukin (IL)-1β, IL-6, tumor necrosis factor (TNF)-α, MDA and MPO, and increased SOD release in CPB rats (P<0.05). Additionally, in the CPB group without the HRS treatment, the expression levels of B-cell lymphoma (Bcl)-2, JAK2, phospho-JAK2 (p-JAK2), STAT3 and phospho-STAT3 (p-STAT3) were significantly decreased, and Bax was significantly increased, compared with the Sham group (P<0.05). By contrast, compared with the CPB group, the expression levels of B-cell lymphoma 2 (Bcl-2), JAK2, phosphorylated (p)-JAK2, STAT3 and p-STAT3 in the HRS group were significantly increased, and Bcl-2-associated X protein expression was significantly decreased (P<0.05). In JAK2 knockdown experiments using siRNA, HRS treatment following hypoxia/reoxygenation also significantly increased the viability of myocardial cells, decreased the rate of myocardial cell apoptosis, elevated the levels of SOD and suppressed the release of MDA and lactate dehydrogenase in the control siRNA and CPB groups (P<0.05). Furthermore, JAK2 siRNA attenuated these protective effects of HRS (P<0.05 vs. control siRNA, HRS and CPB groups). Additionally, the results demonstrated that the HRS treatment significantly increased the expression levels of p-JAK2, p-STAT3 and Bcl-2 in myocardial cells following hypoxia and decreased Bax expression in the control siRNA and CPB groups (P<0.05). In addition, JAK2 siRNA was determined to attenuate these effects of HRS (P<0.05 vs. control siRNA, HRS and CPB groups). Taken together, these results indicated that HRS may alleviate CPB-induced myocardial injury, inhibit myocardial cell apoptosis and protect myocardial cells through regulation of the JAK2/STAT3 signaling pathway.