This Tree’s Leaves Look Soft and Inviting. Please Don’t Touch Them.

The lore that shrouds Australia’s giant stinging trees, of the genus Dendrocnide, is perhaps as dubious as it is vast. Tales abound of nightmarish encounters with the hypodermic-needle-like hairs of its leaves injecting a toxin that drives men to madness and has prompted horses to hurl themselves off cliffs.

Some of these stories are centuries old and cannot be verified. But as Edward Gilding can attest, these legends contain at least one lick of truth: the absolute agony of being stabbed by the fine, downy hairs that adorn the leaves and stems of Dendrocnide. The trees, which can grow taller than 100 feet, are found throughout the rain forests of eastern Australia, where they are known to torment hikers.

“It’s like having a nail shoved into your flesh,” said Dr. Gilding, a biologist at the University of Queensland and self-described sting connoisseur.

The sting from the trees’ hairs also has immense staying power, doling out anguish in waves for hours or days. Some anecdotes have reported intermittent pain lasting months; a few especially bad stings have even landed people in the hospital.

For most victims, such lingering misery might be incentive enough to shun the plants. But Dr. Gilding and a few like-mindedly masochistic colleagues have instead labored to decipher what gives Dendrocnide its punch.

Dozens of experiments and countless stings later, they have identified some of the ingredients involved. As they report Wednesday in the journal Science Advances, Australia’s stinging trees are packed with a toxin that, when injected, latches onto pain-detecting cells in the recipient and makes them go haywire, locking the afflicted area into the molecular equivalent of an infinite scream.

“So many things induce pain, and so little is known about why,” said Isaac Chiu, a neurobiologist at Harvard University who was not involved in the study. Dr. Chiu noted that the trees’ toxins target a molecule, found on nerve cells, that is “fundamental to mammalian pain,” he said. “If this reveals something that blocks that, it would be really exciting.”

The painful potency of Dendrocnide plants has bedeviled researchers for decades. The trees so often harm people that many their habitats are marked by cautionary signage, warning unwary visitors to “beware the stinging tree.” People who frequent these forests sometimes carry respirators, heavy-duty gloves and a fistful of antihistamines.

But even scientists driven enough to inject themselves with extracts made from the trees’ toxins have not been able to work out the source of the sting, said Irina Vetter, a pain researcher at the University of Queensland and an author on the new study.

Those experiments, which are ethically gray, can no longer be conducted, Dr. Vetter said. But she, Dr. Gilding and their colleagues were still able to separate out the chemical components of the toxin from two Dendrocnide species and create synthetic versions of the compounds in the lab. One very small protein found in both plants made mice lick and nip at the spots where it was injected. Dumped onto nerve cells, the molecule flipped the trigger-happy cells into an “on” position, forcing them to send out a deluge of signals.

The researchers named the minute, pain-causing molecules gympietides, in homage to gympie-gympie, the word for stinging tree in the language of the Gubbi Gubbi people, a group of Indigenous Australians.

Dr. Vetter was amazed to find that the gympietides bore a remarkable resemblance to toxins made by venomous spiders and cone snails, which use the chemicals to incapacitate their hapless prey.

“These are three widely divergent groups of organisms — spiders, cone snails and now these trees — producing a toxin that’s very similar,” said Shabnam Mohammadi, a toxin researcher at the University of Nebraska-Lincoln who was not involved in the study.

It’s a stunning example, she added, of different branches of the tree of life converging on the same solution.

The researchers are not müddet how the toxin benefits Dendrocnide trees. Perhaps it serves as a sort of chemical armor to ward off hungry herbivores, Dr. Vetter said. But some animals, like beetles and pademelons — petite relatives of kangaroos — seem to gladly munch on Dendrocnide foliage, stinging spines and all.

Dr. Chiu and Dr. Mohammadi both said they suspect that gympietides are not the only factors that make Dendrocnide toxin so tough to take, especially given the plants’ bizarre and persistent side effects. Some of Dr. Vetter’s previous tussles with the trees have resulted in chest pain and shooting discomfort in her extremities, among other symptoms.

“I think they’ve just scratched the surface of what these plants contain,” Dr. Mohammadi said.

Until more of those mystery ingredients are identified, Dr. Gilford recommended steering clear of stinging trees. “If you work with the plant, it’s pretty much impossible to not get stung,” he said.

That challenge is made more difficult by the plant’s inviting appearance, Dr. Gilford noted. The same hairs that can deliver a dose of unbelievable pain make the leaves and stems look deceptively soft and felty, “like it’s a furry, friendly green plant that you’d want to rub,” he said.

In case it’s not yet clear: Don’t.