Neural tube defects (NTDs) represent a developmental disorder of the nervous system that can lead to significant disability in children and impose substantial social burdens. Valproic acid (VPA), a widely prescribed first-line antiepileptic drug for epilepsy and various neurological conditions, has been associated with a 4-fold increase in the risk of NTDs when used during pregnancy. Consequently, urgent efforts are required to identify innovative prevention and treatment approaches for VPA-induced NTDs. Studies have demonstrated that the disruption in the delicate balance between cell proliferation and apoptosis is a crucial factor contributing to NTDs induced by VPA. Encouragingly, our current data reveal that melatonin (MT) significantly inhibits apoptosis while promoting the restoration of neuroepithelial cell proliferation impaired by VPA. Moreover, further investigations demonstrate that MT substantially reduces the incidence of neural tube malformations resulted from VPA exposure, primarily by suppressing apoptosis through the modulation of intracellular reactive oxygen species levels. In addition, the Src/PI3K/ERK signaling pathway appears to play a pivotal role in VPA-induced NTDs, with significant inhibition observed in the affected samples. Notably, MT treatment successfully reinstates Src/PI3K/ERK signaling, thereby offering a potential underlying mechanism for the protective effects of MT against VPA-induced NTDs. In summary, our current study substantiates the considerable protective potential of MT in mitigating VPA-triggered NTDs, thereby offering valuable strategies for the clinical management of VPA-related birth defects.