Summary: The hindrance of kernel development caused by waterlogging stress (WS) is the direct reason for the peanut yield reduction. Currently, the mechanism of kernel filling responding to WS remains unknown. The waterlogging-sensitive variety Huayu 39 was subjected to WS for 3 days after 7 days after gynophores touched the ground (DAG), and the key stage of WS affecting kernel filling is 14, 21, and 28 DAG. WS decreased the average filling rate and kernel dry weight. Therefore, transcriptome sequencing and widely-targeted metabolomic analysis were conducted on kernel to elucidate the mechanism for the decrease in average filling rate under WS, revealing that overexpression of the gene encoding tryptophan decarboxylase ( AhTDC), which caused the accumulation of melatonin, reduced kernel weight. The sucrose transformation rate was limited by the crosstalk between melatonin and ethylene, thereby reducing the kernel filling rate and hindering kernel development. Our results are crucial for formulating measures to alleviate the negative impact of WS on peanut yield and quality, providing a basis for exploring high-yield and high-quality cultivation, molecular-assisted breeding, and waterlogging prevention.