Sperm are specialized cells that require adenosine triphosphate (ATP) to support their function. Maintaining sperm energy homeostasis in vitro is vitally important to improve the efficacy of boar sperm preservation. Metformin can activate 5′-AMP-activated protein kinase (AMPK) to improve metabolic flexibility and maintain energy homeostasis. Thus, the aim of the present study was to investigate whether metformin can improve boar sperm quality through AMPK mediation of energy metabolism. Sperm motility parameters, membrane integrity, acrosome integrity, mitochondrial membrane potential (ΔΨm), ATP content, glucose uptake, and lactate efflux were analyzed. Localization and expression levels of AMPK and phospho-Thr172-AMPK (p-AMPK) were also detected by immunofluorescence and western blotting. We found that metformin treatment significantly increased sperm motility parameters, ΔΨm, and ATP content during storage at 17 °C. Moreover, results showed that AMPK was localized at the acrosomal region, connecting piece, and midpiece of sperm and p-AMPK was distributed at the post-acrosomal region, connecting piece, and midpiece. When sperm were incubated with metformin for 4 h at 37 °C, sperm motility parameters, ΔΨm, ATP content, p-AMPK, glucose uptake, and lactate efflux all significantly increased, whereas the addition of Compound C treatment, an inhibitor of AMPK, counteracted these positive effects. Together, our results suggest that metformin promotes AMPK activation, which contributes to the maintenance of energy hemostasis and mitochondrial activity, thereby maintaining boar sperm functionality and improving the efficacy of semen preservation.