In this study, we aimed to evaluate the anti-inflammatory and anti-apoptotic effects of melatonin (MLT) on neuropathic pain (NP)-induced anxiety and depression in a rat model. Adult male rats were separated into four groups, i.e., Sham-VEH: healthy animals received a vehicle, Sham-MLT (10 mg/kg), and chronic constrictive injury (CCI)-VEH: nerve ligation received the vehicle, and CCI-MLT. Next, we used behavioral tests to evaluate pain severity, anxiety, and depression. Finally, rats were sacrificed for molecular and histopathological studies. Behavioral tests showed that NP could induce depressive- and anxiety-like behaviors. NP activated NF-κB/NLRP3 inflammasome pathways by upregulating NF-κB, NLRP3, ASC, active Caspase-1, also enhancing the concentrations of cytokines (IL-1β and IL-18) in the prefrontal cortex (PFC) and hippocampus (HC). NP upregulated Bax, downregulated Bcl2, and increased cell apoptosis in the HC and PFC. The rats treated with MLT eliminated the effects of NP, as the reduced pain severity, improved anxiety- and depressive-like behaviors, ameliorated NF-κB/NLRP3 inflammasome pathways, and modulated levels of cytokines in the HC and PFC. MLT could promote cell survival from apoptosis by modulating Bax and Bcl2. Therefore, it might be inferred that its anti-inflammatory and anti-apoptotic properties mediate the beneficial effects of MLT in NP-induced affective disorders.