Neuropathic pain is a debilitating clinical problem and difficult to treat. Nerve injury causes a long-lasting reduction in K(+) channel expression in the dorsal root ganglion (DRG), but little is known about the epigenetic mechanisms involved. We found that nerve injury increased dimethylation of Lys9 on histone H3 (H3K9me2) at Kcna4, Kcnd2, Kcnq2 and Kcnma1 promoters but did not affect levels of DNA methylation on these genes in DRGs. Nerve injury increased activity of euchromatic histone-lysine N-methyltransferase-2 (G9a), histone deacetylases and enhancer of zeste homolog-2 (EZH2), but only G9a inhibition consistently restored K(+) channel expression. Selective knockout of the gene encoding G9a in DRG neurons completely blocked K(+) channel silencing and chronic pain development after nerve injury. Remarkably, RNA sequencing analysis revealed that G9a inhibition not only reactivated 40 of 42 silenced genes associated with K(+) channels but also normalized 638 genes down- or upregulated by nerve injury. Thus G9a has a dominant function in transcriptional repression of K(+) channels and in acute-to-chronic pain transition after nerve injury.