We report that GTP cyclohydrolase (GCH1), the rate-limiting enzyme for tetrahydrobiopterin (BH4) synthesis, is a key modulator of peripheral neuropathic and inflammatory pain. BH4 is an essential cofactor for catecholamine, serotonin and nitric oxide production. After axonal injury, concentrations of BH4 rose in primary sensory neurons, owing to upregulation of GCH1. After peripheral inflammation, BH4 also increased in dorsal root ganglia (DRGs), owing to enhanced GCH1 enzyme activity. Inhibiting this de novo BH4 synthesis in rats attenuated neuropathic and inflammatory pain and prevented nerve injury-evoked excess nitric oxide production in the DRG, whereas administering BH4 intrathecally exacerbated pain. In humans, a haplotype of the GCH1 gene (population frequency 15.4%) was significantly associated with less pain following diskectomy for persistent radicular low back pain. Healthy individuals homozygous for this haplotype exhibited reduced experimental pain sensitivity, and forskolin-stimulated immortalized leukocytes from haplotype carriers upregulated GCH1 less than did controls. BH4 is therefore an intrinsic regulator of pain sensitivity and chronicity, and the GTP cyclohydrolase haplotype is a marker for these traits.