Alleviating heavy metal pollution in farmland soil, and heavy metal toxicity in plants is the focus of global agricultural environmental research. Melatonin is a kind of indoleamine compound that wide exists in organisms; it is currently known as an endogenous free radical scavenger with the strongest antioxidant effect. As a new plant growth regulator and signaling molecule, melatonin plays an important role in plant resistance to biotic or abiotic stress. Recent studies indicate that melatonin can effectively alleviate heavy metal toxicity in crop plants, which provides a new strategy to minimize heavy metal pollution in crop plants. This study summarizes the research progress on the role of melatonin in alleviating heavy metal toxicity in crop plants and the related physiological and ecological mechanisms such as reducing the concentration of heavy metals in the rhizosphere, fixing and regionally isolating of heavy metals, maintaining the mineral element balance, enhancing the antioxidant defense system and interacting with hormonal signaling. Furthermore, future prospects for the mechanism of melatonin in regulating heavy metal toxicity, the pathway regulating synthesis and catabolism, and the interaction mechanism of melatonin signaling and other phytohormones are presented in this paper, with the goal of providing a theoretical basis for controlling heavy metal ion accumulation in crop plants grown in contaminated soil.