Nociception allows for immediate reflex withdrawal whereas pain allows for longer-term protection via rapid learning. We examine here whether shore crabs placed within a brightly lit chamber learn to avoid one of two dark shelters when that shelter consistently results in shock. Crabs were randomly selected to receive shock or not prior to making their first choice and were tested again over 10 trials. Those that received shock in trial 2, irrespective of shock in trial 1, were more likely to switch shelter choice in the next trial and thus showed rapid discrimination. During trial 1, many crabs emerged from the shock shelter and an increasing proportion emerged in later trials, thus avoiding shock by entering a normally avoided light area. In a final test we switched distinctive visual stimuli positioned above each shelter and/or changed the orientation of the crab when placed in the chamber for the test. The visual stimuli had no effect on choice, but crabs with altered orientation now selected the shock shelter, indicating that they had discriminated between the two shelters on the basis of movement direction. These data, and those of other recent experiments, are consistent with key criteria for pain experience and are broadly similar to those from vertebrate studies.