Melatonin (MLT; N-acetyl-5-methoxytryptamine) exhibits analgesic properties in chronic pain conditions. While researches linking MLT to epigenetic mechanisms have grown exponentially over recent years, very few studies have investigated the contribution of MLT-associated epigenetic modification to pain states. Here, we report that together with behavioral allodynia, spinal nerve ligation (SNL) induced a decrease in the expression of catalytic subunit of phosphatase 2A (PP2Ac) and enhanced histone deacetylase 4 (HDAC4) phosphorylation and cytoplasmic accumulation, which epigenetically alleviated HDAC4-suppressed hmgb1 gene transcription, resulting in increased high-mobility group protein B1 (HMGB1) expression selectively in the ipsilateral dorsal horn of rats. Focal knock-down of spinal PP2Ac expression also resulted in behavioral allodynia in association with similar protein expression as observed with SNL. Notably, intrathecal administration with MLT increased PP2Ac expression, HDAC4 dephosphorylation and nuclear accumulation, restored HDAC4-mediated hmgb1 suppression and relieved SNL-sensitized behavioral pain; these effects were all inhibited by spinal injection of 4P-PDOT (a MT2 receptor antagonist, 30 minutes before MLT) and okadaic acid (OA, a PP2A inhibitor, 3 hr after MLT). Our findings demonstrate a novel mechanism by which MLT ameliorates neuropathic allodynia via epigenetic modification. This MLT-exhibited anti-allodynia is mediated by MT2-enhanced PP2Ac expression that couples PP2Ac with HDAC4 to induce HDAC4 dephosphorylation and nuclear import, herein increases HDAC4 binding to the promoter of hmgb1 gene and upregulates HMGB1 expression in dorsal horn neurons.