We aimed to assess the efficacy and safety of sodium-glucose cotransporter-2 inhibitors (SGLT2i) versus placebo, initiated within the hospitalization period, in addition to habitual treatment, for treating adult patients with confirmed acute myocardial infarction (AMI). We also conducted subgroup analysis by diabetes mellitus (DM) status and type of AMI. We systematically searched PubMed, Embase, and Cochrane Library for randomized controlled trials (RCTs). The primary outcome was hospitalization for heart failure (HF). The secondary outcomes were all-cause death, cardiovascular death, and serious adverse events (AEs). We pooled risk ratios (RR) with a 95% confidence interval (CI) for binary outcomes. The between-study variance was assessed using tau2 statistics. We included five RCTs, encompassing 11,211 patients. SGLT2i significantly reduced the risk of hospitalization for HF compared to placebo (RR 0.73; 95% CI [0.61, 0.88]). However, the risk of all-cause death (RR 1.05; 95% CI [0.78, 1.41]) and cardiovascular death (RR 1.04; 95% CI [0.84, 1.29]) was similar between the groups, as well as the risk of serious AEs (RR 1.01; 95% CI [0.90, 1.14]). In the subgroup analysis by DM status and type of AMI, there were no significant subgroup differences for the outcomes of hospitalization for HF and all-cause death. In patients with AMI, treatment with SGLT2i is safe and significantly reduces the risk of hospitalization for HF, but it has no impact on all-cause death and cardiovascular death compared to placebo.