Myocardial fibrosis is one of the most important pathological features of alcoholic cardiomyopathy (ACM). Hydrogen sulfide (H2S) exerts protective effects in various types of cardiovascular disease, which has been demonstrated by many previous studies. However, there is a lack of adequate research on the effect of H2S on myocardial fibrosis in ACM. The present study aimed to investigate the etiopathogenic role of H2S in myocardial fibrosis induced by chronic alcohol intake. An ACM mouse model was induced by consumption of 4% ethanol solution in drinking water for 12 weeks. Sodium hydrosulfide (NaHS) was used as a donor to provide exogenous H2S. Twelve weeks later, mice were sacrificed to calculate the heart to body weight ratio. The degree of myocardial collagen deposition was evaluated by Masson's and Van Gieson's staining, the expression level of collagen I was measured by immunohistochemistry and autophagosomes were observed by transmission electron microscopy. In addition, the expression levels of autophagy-associated proteins and fibrosis-associated proteins were detected by western blotting, and the expression levels of miR-21 and miR-211 were detected by reverse transcription-quantitative polymerase chain reaction. The outcomes of the study revealed that chronic alcohol intake results in myocardial fibrosis, enhanced myocardial collagen deposition and increased expression levels of collagen I, autophagy, autophagy-associated proteins (Beclin 1, Atg3 and Atg7) and fibrosis-associated proteins (MMP8, MMP13, MMP14, MMP17 and TGF-β1), as well as miR-21 and miR-221. These results were markedly reversed following treatment with H2S. The present study confirmed that H2S relieves myocardial fibrosis in mice with ACM, and the underlying mechanism may involve the downregulation of autophagy and miR-21 and miR-211 expression levels.