Salt stress is a major limiting factor for alfalfa yield due to its relatively low salt tolerance. High soil salinity adversely impacts alfalfa growth and development, leading to reduced yield. Melatonin (MT) is known to play a significant role in enhancing plant resistance to abiotic stresses. However, the mechanisms underlying melatonin-mediated abiotic stress responses, particularly salt stress, are not well understood. To address this gap, we conducted a study focusing on germinating alfalfa seeds under salt stress. Physiological indexes and transcriptomics analyses were carried out on the germinated seeds to investigate the effects of melatonin on alfalfa seedlings under salt stress conditions. Our results revealed that the application of melatonin led to an increase in shoot length and fresh weight of alfalfa seedlings under salt stress. Moreover, key physiological indexes such as peroxidase (POD) activity and glutathione (GSH) content were enhanced, while levels of malondialdehyde and superoxide anions decreased. Transcriptomic analysis identified a total of 2,131 differentially expressed genes in the salt-treated group, with 726 up-regulated and 1,405 down-regulated genes, while the MT-treated group showed 2896 differentially expressed genes, of which 1,097 were up-regulated and 1,799 were down-regulated. Further, KEGG enrichment analysis highlighted the enrichment of differentially expressed genes in pathways including flavonoid biosynthesis, ABC transporter, glutathione metabolism, and the MAPK signaling pathway, with these pathways more significantly enriched in the MT-treated group. These findings collectively suggest that melatonin plays a crucial role in alfalfa's response to salt stress and offer new insights into the genomic mechanisms underlying melatonin-mediated salt tolerance in alfalfa.