Scientists argue that itching is most likely related to grooming, and evolved to protect animals against some toxic plants, as well as insects, along with the diseases they can transmit, like malaria, yellow fever and river blindness. But the biology of itch has been a mystery, and neglected for years by researchers, who have been far more focused on pain.

Some 50 diseases leave people in a misery of itching which usually cannot be treated. Studies among kidney disease patients and psychiatric inpatients have found that itch is among the top complaints. And when it is severe it keeps people up at night, often worsening their condition.

The new study suggests that itch, like pain, may be a “gated” system in which signals from other nerve cells can interfere with or moderate the sensation. Scratching the skin near, but not directly on, the spot that itches often provides relief, just as rubbing an aching limb can reduce pain. Perceptions in the brain, too, probably moderate the urge to scratch: some chronic, compulsive cases of itching suggest that the brain is not properly reading the effect of outside signals at all but is instead acting on a mistaken internal representation of what is happening to the skin.

As with some kinds of pain, subtle reminders of an itching sensation can get people scratching, often without being entirely aware of it.

“I give lectures about itching,” Dr. Giesler said, “and I’ll stand up there in front of a whole roomful of people, show a few slides and pretty soon I’ll look out and 90 percent of the audience is scratching.”

Like yawning, itching also seems to be contagious, which suggests a significant top-down influence from the brain.

Dr. Yosipovitch said there was a long way to go before doctors could expect treatments. For one thing, the miserable, chronic itch common in many medical problems most likely involves other mechanisms in addition to those identified in the study. And the brain may be critically involved in escalating itch, in ways that are not yet understood. “But as a clinician, I feel excited about the finding,” he said. “It’s a sign that this field is really evolving.”