The hyperpolarization-activated current (Ih) is an inward current activated by hyperpolarization from the resting potential and is an important modulator of action potential firing frequency in many excitable cells. Four hyperpolarization-activated, cyclic nucleotide-modulated subunits, HCN1–4, can form Ih ion channels. In the present study we investigated the function of Ih in primary somatosensory neurons. Neuronal firing in response to current injection was promoted by elevating intracellular cAMP levels and inhibited by blockers of Ih, suggesting that Ih plays a critical role in modulating firing frequency. The properties of Ih in three size classes of sensory neurons were next investigated. In large neurons Ih was fast activating and insensitive to elevations in cAMP, consistent with expression of HCN1. Ih was ablated in most large neurons in HCN1−/− mice. In small neurons a slower activating, cAMP-sensitive Ih was observed, as expected for expression of HCN2 and/or HCN4. Consistent with this, Ih in small neurons was unchanged in HCN1−/− mice. In a neuropathic pain model HCN1−/− mice exhibited substantially less cold allodynia than wild-type littermates, suggesting an important role for HCN1 in neuropathic pain. This work shows that Ih is an important modulator of action potential generation in somatosensory neurons.