A particularly grumpy type of crab deterred predators by growling them with teeth in the stomach, as new research has shown.

The sounds generated by both male and female ghost crabs, according to scientists, occur in "aggressive interactions."

It is the first known event in which an animal can communicate with stomach sounds and attack its claws.

The rumbling is caused by "co-opting the gastric mill (forefingement of the forearm)," the researchers added, and is loud enough for people to hear unaided.

Biologist Jennifer Taylor of the California Scripps Institution of Oceanography said the abdominal vibrations were "definitely an advantage when a predator is up close".

"They can pull their claws out and be ready to jump out, but still produce those sounds," she told The Guardian.

Ms. Taylor added that "ghost crabs have developed special structures on their claws to make sounds, but they also adopt this second method as a backup."

If their claws are already busy, "they can make the same sounds internally".

Brain crabs – also called sand crabs – have one claw larger than the other, thick and elongated eye stalks and a boxy body.

The research is published in Proceedings of the Royal Society B: Biological Sciences.