Acute myocardial infarction (AMI) is a condition with high morbidity and mortality, for which effective treatments are lacking. Allicin has been reported to exert therapeutic effects on AMI, but the underlying mechanisms of its action have not been fully elucidated. To investigate this, a rat model of AMI was generated by ligating the left anterior descending branch of the coronary artery. DL-propargylglycine (PAG), a specific hydrogen sulfide (H2S) synthetase inhibitor, was used to examine the effects of allicin on H2S production. Isolated coronary arteries and cardiomyocytes were assessed for vascular reactivity and cellular Ca2+ transport using a multiwire myography system and a cell-contraction-ion detection system, respectively. Allicin administration improved cardiac function and myocardial pathology, reduced myocardial enzyme levels, and increased H2S and H2S synthetase levels. Allicin administration resulted in concentration-dependent effects on coronary artery dilation, which were mediated by receptor-dependent Ca2+ channels, ATP-sensitive K+ channels, and sarcoplasmic reticulum (SR) Ca2+ release induced by the ryanodine receptor. Allicin administration improved Ca2+ homeostasis in cardiomyocytes by increasing cardiomyocyte contraction, Ca2+ transient amplitude, myofilament sensitivity, and SR Ca2+ content. Allicin also enhanced Ca2+ uptake via SR Ca2+-ATPase and Ca2+ removal via the Na+/Ca2+ exchanger, and it reduced SR Ca2+ leakage. Notably, the protective effects of allicin were partially attenuated by blockade of H2S production with PAG. Our findings provide novel evidence that allicin-induced production of H2S mediates coronary artery dilation and regulation of Ca2+ homeostasis in AMI. Our study presents a novel mechanistic insight into the anti-AMI effects of allicin and highlights the therapeutic potential of this compound.