To observe the effects of melatonin on autophagy in cortical neurons of neonatal rats with hypoxic-ischemic brain damage (HIBD) and to explore its mechanisms via the PI3K/AKT signaling pathway, aiming to provide a basis for the clinical application of melatonin. Seven-day-old Sprague-Dawley neonatal rats were randomly divided into a sham operation group, an HIBD group, and a melatonin group (n=9 each). The neonatal rat HIBD model was established using the classic Rice-Vannucci method. Neuronal morphology in the neonatal rat cerebral cortex was observed with hematoxylin-eosin staining and Nissl staining. Autophagy-related protein levels of microtubule-associated protein 1 light chain 3 (LC3) and Beclin-1 were detected by immunofluorescence staining and Western blot analysis. Phosphorylated phosphoinositide 3-kinase (p-PI3K) and phosphorylated protein kinase B (p-AKT) protein expression levels were measured by immunohistochemistry and Western blot. The correlation between autophagy and the PI3K pathway in the melatonin group and the HIBD group was analyzed using Pearson correlation analysis. Twenty-four hours post-modeling, neurons in the sham operation group displayed normal size and orderly arrangement. In contrast, neurons in the HIBD group showed swelling and disorderly arrangement, while those in the melatonin group had relatively normal morphology and more orderly arrangement. Nissl bodies were normal in the sham operation group but distorted in the HIBD group; however, they remained relatively intact in the melatonin group. The average fluorescence intensity of LC3 and Beclin-1 was higher in the HIBD group compared to the sham operation group, but was reduced in the melatonin group compared to the HIBD group (P<0.05). The number of p-PI3K+ and p-AKT+ cells decreased in the HIBD group compared to the sham operation group but increased in the melatonin group compared to the HIBD group (P<0.05). LC3 and Beclin-1 protein expression levels were higher, and p-PI3K and p-AKT levels were lower in the HIBD group compared to the sham operation group (P<0.05); however, in the melatonin group, LC3 and Beclin-1 levels decreased, and p-PI3K and p-AKT increased compared to the HIBD group (P<0.05). The correlation analysis results showed that the difference of the mean fluorescence intensity of LC3 and Beclin-1 protein in the injured cerebral cortex between the melatonin and HIBD groups was negatively correlated with the difference of the number of p-PI3K+ and p-AKT+ cells between the two groups (P<0.05). Melatonin can inhibit excessive autophagy in cortical neurons of neonatal rats with HIBD, thereby alleviating HIBD. This mechanism is associated with the PI3K/AKT pathway.