Can crabs feel pain? New research on the clawed crustaceans suggests the answer is yes.

A group of UK researchers came to this conclusion by examining the reactions of common shore crabs to mild electric shocks in a study released today in the Journal of Experimental Biology. The key to their finding is the distinction between the nervous system activity known as nociception and pain, which is defined as an unpleasant sensory and emotional experience. For years, many researchers assumed crustaceans such as crabs experienced the former, but not the latter.

Nociception—which differs from pain in that it isn’t subjective—is produced by the peripheral and central nervous systems in reaction to potentially tissue-damaging stimuli. All animals experience this reflex, including humans—for example, the nerve endings (called nociceptors) under our skin transmit a signal along our spinal cord to the brain when we touch a too-hot plate, and we automatically jerk our hands back.

For crabs, nociception provides immediate protection following a small electric shock, but it shouldn’t trigger any changes in its later behavior. That’s a job for pain—it helps organisms learn to avoid the harmful source in the future.

In this study, the crabs appeared to do just that. Ninety crabs were placed in a tank with two areas without a light source, one crab at a time. After the crabs scuttled toward the dark area they liked best, they were removed from the tank and exposed to a mild electric shock.

Following a rest period, each of the crabs was returned to the tank. Most of the crustaceans returned to the shelter they’d picked the first time. Those who had received a shock in the first round were zapped again, and when they were introduced into the tank for the third time, the majority moved to the other, presumably shock-free safe area. Crabs who hadn’t been shocked returned once again to their first-choice area.

Dark hideaways, like under rocks along waterbeds, are important to these creatures because they offer protection from predators. After receiving the electric shocks, the decapods chose to trade in safety to avoid the unpleasant experience in the future.

“Having experienced two rounds of shocks, the crabs learned to avoid the shelter where they received the shock,” said study co-author Bob Elwood, an animal behavior professor at the School of Biological Sciences at Queen’s University Belfast, in a statement. “They were willing to give up their hideaway in order to avoid the source of their probable pain.”

So did the crabs remember the pain? The researchers say it’s possible, and previous work by Elwood and others supports the idea.

In a 2009 study with hermit crabs, wires attached to the creatures’ shells delivered small shocks to their abdomens, which they typically protect by crawling into empty mollusk shells. The only crabs to abandon their shells in search of others had previously incurred electric shocks, which researchers say means the crabs found the experience unpleasant—and perhaps ouch-worthy.

A new shell was then offered, and those crabs that had been shocked but remained in their original homes moved quickly toward the new option, investigated it for a shorter time and were more likely to make the switch than those who hadn’t been shocked. Experiencing shocks changed the hermit crabs’ motivation, much like the way we choose not to touch that hot plate again.

Such behavioral changes were also the subject by a 2007 paper by Elwood, with a different crustacean, the prawn. Various noxious stimuli introduced to prawns’ antennae elicited a reflexive tail flick. But after that, the prawns groomed their antennae and rubbed them against the side of their tanks, prolonged activities that, researchers say, signal the experience of pain.

While it’s impossible to explicitly demonstrate that crustaceans like crabs, prawns and lobsters feel pain, researchers hope these findings spur investigation of how the marine animals are handled in aquaculture and in the kitchen, where chefs often declaw or boil crabs alive.