Our understanding of the biology of pain is limited by our ignorance about its evolution. We know little about how states in other species showing various degrees of apparent similarity to human pain states are related to human pain, or how the mechanisms essential for pain-related states evolved. Nevertheless, insights into the evolution of mechanisms and behaviour important for pain are beginning to emerge from wide-ranging investigations of cellular mechanisms and behavioural responses linked to nociceptor activation, tissue injury, inflammation and the environmental context of these responses in diverse species. In February 2019, an unprecedented meeting on the evolution of pain hosted by the Royal Society brought together scientists from disparate fields who investigate nociception and pain-related behaviour in crustaceans, insects, leeches, gastropod and cephalopod molluscs, fish and mammals (primarily rodents and humans). Here, we identify evolutionary themes that connect these research efforts, including adaptive and maladaptive features of pain-related behavioural and neuronal alterations-some of which are quite general, and some that may apply primarily to humans. We also highlight major questions, including how pain should be defined, that need to be answered as we seek to understand the evolution of pain. This article is part of the Theo Murphy meeting issue 'Evolution of mechanisms and behaviour important for pain'.