Diospyros lotus L., cultivated for both its edible and medicinal qualities, frequently experiences drought stress during the growth phase. Tryptophan-derived melatonin effectively enhances drought resistance in plants. However, the role of melatonin in the tolerance of D. lotus to drought stress as well as recovery after droughts stress elimination remains unclear. This study investigated the underlying mechanisms by which melatonin alleviates D. lotus drought stress and recovery. Melatonin significantly reduced reactive oxygen species levels and alleviated the inhibitory effect of drought stress by activating the antioxidant system. Melatonin influences pathways related to sugar metabolism and flavonoid biosynthesis, which may facilitate plant recovery from drought stress. Integrated transcriptome and metabolome analyses revealed that melatonin induced genes and metabolites associated with sugar metabolism (Cluster-28045.33805, Cluster-28045.59949, Cluster-28045.59252, Cluster-28045.54252, Cluster-28045.44982, fructose, l-threose, and glyceraldehyde-3-phosphate), facilitating plant recovery from drought. Differentially enriched microorganisms suggest that melatonin induces plants to recruit potentially beneficial microorganisms (such as Skermanella, Nocardioides, Ralstonia, and Rhodococcus), which enhances drought tolerance and recovery. Integrative analysis of the microbiome and metabolome suggests that a unique metabolite, 3-hydroxy-butanoic acid, which was induced significantly by melatonin, may play a vital role in attracting beneficial microorganisms to facilitate drought stress resistance. Our results demonstrate that melatonin enhances D. lotus recovery from drought by recruiting beneficial microorganisms, thereby boosting both transcriptomic and physiological resilience. Our findings aim to mitigate the impact of drought on agricultural production.