After more than 100,000 years of evolutionary success in Western Eurasia, Neanderthals rapidly went extinct between 40,000 and 30,000 years ago, almost coinciding with the spread of Anatomically Modern Homo sapiens (AMHS) in Europe. Several scenarios relate their extinction to competition with AMHS, climatic changes during the last glacial period or a combination of both. Here we propose a much simpler scenario, in which the cannibalistic behaviour of Neanderthals may have played a major role in their eventual extinction. We show that this trait was selected as a common behaviour at moments of environmental or population stress. However, as soon as Neanderthals had to compete with another species that consumed the same resources (AMHS in this case) cannibalism had a negative impact, leading, in the end, to their extinction. To test this hypothesis, we used an agent-based model computer simulation. The model is simple, with only traits, behaviours and landscape features defined and with no attempt to re-create the exact landscape in which Neanderthals lived or their cultural characteristics. The basic agent of our system is a group of individuals that form a community. The most important state variable of our model is the location of the group, coupled with a defined home range and two additional factors: cannibalism and the chance of fission. The result of the simulation shows that cannibalistic behaviour is always selected when resources are scarce and clustered. However, when a non-cannibalistic species (late Pleistocene AMHS) is introduced into the same environment, the cannibalistic species retreats and the new species grows until it has reached the carrying capacity of the system. The cannibalistic populations that still survive are displaced from the richest areas, and live on the borders with arid zones, a situation which is remarkably similar to what we know about the end of the Neanderthals.