Persistent neuroinflammatory response after cauda equina injury (CEI) lowers nociceptor firing thresholds, accompanied by pathological pain and decreasing extremity dysfunction. Histone deacetylation has been considered a key regulator of immunity, inflammation, and neurological dysfunction. Our previous study suggested that valproic acid (VPA), a histone deacetylase inhibitor, exhibited neuroprotective effects in rat models of CEI, although the underlying mechanism remains elusive. The cauda equina compression surgery was performed to establish the CEI model. The Basso, Beattie, Bresnahan score, and the von Frey filament test were carried out to measure the animal behavior. Immunofluorescence staining of myelin basic protein and GPX4 was carried out. In addition, transmission electron microscope analysis was used to assess the effect of VPA on the morphological changes of mitochondria. RNA-sequencing was conducted to clarify the underlying mechanism of VPA on CEI protection. In this current study, we revealed that the expression level of HDAC1 and HDAC2 was elevated after cauda equina compression model but was reversed by VPA treatment. Meanwhile, HDAC2 knockdown resulted in the improvement of motor functions and pathologic pain, similar to treatment with VPA. Histology analysis also showed that knockdown of histone deacetylase (HDAC)-2, but not HDAC1, remarkably alleviated cauda equina injury and demyelinating lesions. The potential mechanism may be related to lowering oxidative stress and inflammatory response in the injured region. Notably, the transcriptome sequencing indicated that the therapeutic effect of VPA may depend on HDAC2-mediated ferroptosis. Ferroptosis-related genes were analyzed invivo and DRG cells further validated the reliability of RNA-sequencing results, suggesting HDAC2-H4K12ac axis participated in epigenetic modulation of ferroptosis-related genes. HDAC2 is critically involved in the ferroptosis and neuroinflammation in cauda equina injury, and VPA ameliorated cauda equina injury by suppressing HDAC2-mediated ferroptosis.