Heavy metal-associated isoprenylated plant proteins (HIPPs) are crucial for metal ion homeostasis and stress responses in plants exposed to heavy metals. They bind heavy metal ions via their HMA domains, sequestering them to prevent cellular toxicity. The C-terminal isoprenylation enhances interactions with membrane proteins, aiding in ion transport and compartmentalization. In Medicago sativa (alfalfa), we identified 23 MsHIPP genes containing conserved HMA domains and C-terminal isoprenylation motifs using bioinformatics tools. Phylogenetic analysis classified these genes into five clades, indicating functional diversity and evolutionary divergence. Promoter analysis revealed cis-regulatory elements associated with responses to light, drought, cold, abscisic acid (ABA), salicylic acid (SA), and auxin, suggesting roles in environmental adaptation. Expression profiling under drought, cold, salt, cadmium (Cd), ABA, and indole-3-acetic acid (IAA) treatments demonstrated the involvement of MsHIPPs in abiotic stress responses. Notably, overexpression of MsHIPP12 in Arabidopsis thaliana enhanced Cd tolerance by increasing antioxidant enzyme activities (APX, CAT, SOD), reducing malondialdehyde (MDA) levels, and attenuating chlorophyll degradation. These findings identify MsHIPP12 as a promising candidate gene for enhancing stress tolerance in M. sativa. This work provides valuable insights for molecular breeding strategies and phytoremediation approaches to address cadmium-contaminated soils.