The sensation of pain protects the body from serious injury. Using exome sequencing, we identified a specific de novo missense mutation in SCN11A in individuals with the congenital inability to experience pain who suffer from recurrent tissue damage and severe mutilations. Heterozygous knock-in mice carrying the orthologous mutation showed reduced sensitivity to pain and self-inflicted tissue lesions, recapitulating aspects of the human phenotype. SCN11A encodes Nav1.9, a voltage-gated sodium ion channel that is primarily expressed in nociceptors, which function as key relay stations for the electrical transmission of pain signals from the periphery to the central nervous system. Mutant Nav1.9 channels displayed excessive activity at resting voltages, causing sustained depolarization of nociceptors, impaired generation of action potentials and aberrant synaptic transmission. The gain-of-function mechanism that underlies this channelopathy suggests an alternative way to modulate pain perception.