The voltage sodium channel 1.8 (Na1.8) in the dorsal root ganglion (DRG) neurons contributes to the initiation and development of chronic inflammatory and neuropathic pain. However, an effective intervention on Na1.8 remains to be studied in pre-clinical research and clinical trials. In this study, we aimed to investigate whether transcription factor 4 (TCF4) overexpression represses Na1.8 expression in DRG neurons, thus preventing the development of chronic pain. Using chromatin immunoprecipitation (CHIP), we verified the interaction of TCF4 and sodium voltage-gated channel alpha subunit 10A (SCN10A) enhancer in HEK293 cells and rat DRG neurons. Using a dual luciferase reporter assay, we confirmed the transcriptional inhibition of TCF4 on SCN10A promoter in vitro. To investigate the regulation of TCF4 on Nav1.8, we then upregulated TCF4 expression by intrathecally delivering an overexpression of recombinant adeno-associated virus (rAAV) in the Complete Freund's adjuvant (CFA)-induced inflammatory pain model and spared nerve injury (SNI)-induced neuropathic pain model. By using a quantitative polymerase chain reaction (qPCR), western blot, and immunostaining, we evaluated Na1.8 expression after a noxious stimulation and the application of the TCF4 overexpression virus. We showed that the intrathecal delivery of TCF4 overexpression virus significantly repressed the increase of Na1.8 and prevented the development of hyperalgesia in rats. Moreover, we confirmed the efficient role of an overexpressed TCF4 in preventing the CFA- and SNI-induced neuronal hyperexcitability by calcium imaging. Our results suggest that attenuating the dysregulation of Na1.8 by targeting TCF4 may be a novel therapeutic strategy for chronic inflammatory and neuropathic pain.