The study involved exposing crabs to mild electric shocks. Scientists say it raises ethical implications for the food industry.
The team from Queen's University in Belfast devised an experiment to distinguish between pain and reflex action.
Lead researcher Professor Bob Elwood said: "Crabs value dark hideaways beneath rocks where they can shelter from predators. Our study tested whether the crabs experienced pain by seeing if they could learn to give up a valued dark hiding place to avoid a mild electric shock."
Ninety crabs were allowed to hide under one of two dark shelters in a tank. Those that picked the wrong one received a shock. When they were returned to the tank, most chose the same shelter and were shocked again. Most then switched to the alternative shelter.
Mr Elwood said this showed crabs were aware of pain. He said the research had welfare implications.
He said: "Crustaceans get little protection as the presumption is they cannot feel pain."