When animals die, their corpses exude a particular "stench of death" that repels their living relatives, who avoid others that have succumbed to the disease or places where predators lurk, scientists have revealed.
Corpses of animals as distantly related as insects and crustaceans all produce the same stench, caused by a blend of simple fatty acids.
This 'death recognition system' likely evolved over 400 million years ago.
Led by Professor David Rollo, the team stumbled upon the phenomenon while studying live cockroaches.
When a cockroach finds a good place to shelter, it gives off pheromones that attract more of its kind.
In a bid to identify the exact chemicals involved, Prof Rollo's team extracted body juices from dead cockroaches to see what effect they had.
"We were astonished to find that nearly 100 percent of cockroaches avoid shelters treated with whole body extracts. Something in the extract was overriding any attractive chemicals," said Prof Rollo.
"We initiated extensive work to figure out what could be so important to make all these insects go away," he added.
After eliminating a host of other possibilities, such as cockroaches producing alarm signals, they considered the idea that a specific chemical is released by the insects upon death.By smelling their dead, cockroaches may be able to avoid predators.
The fraction that was so off-putting to other cockroaches contained nothing but simply fatty acids, with oleic and linoleic acids the two main components.
Further work by another research team showed that a very primitive type of insect called a collembola also uses these same fatty acids to recognise dead kin.
New experiments by Rollo's team have found that terrestrial woodlice use the same chemistry to recognise their dead, using it to avoid both crushed woodlice and intact corpses.
As do two unrelated species of social caterpillar, which usually gather in large numbers.
When tested, both tent moth caterpillars and fall webworms strongly avoided extracts taken from the bodies of other dead caterpillars. They also avoided pure oleic and linoleic acids.
That means that various types of distantly-related insects, as well as woodlice, which are a type of crustacean, share a common system for recognizing death.
"Recognizing and avoiding the dead could reduce the chances of catching the disease, or allow you to get away with just enough exposure to activate your immunity," said Prof. Rollo.