Animals may share food to gain immediate or delayed fitness benefits. Previous studies of sharing have concentrated on delayed benefits such as reciprocity, trade and punishment. This study tests an alternative model (the harassment or sharing–under–pressure hypothesis) in which a food owner immediately benefits because sharing avoids costly harassment from a beggar. I present an experiment that varies the potential ability of the beggar to harass, and of the owner to defend the food, to examine the effects of harassment on food sharing in two primate species: chimpanzees (Pan troglodytes) and squirrel monkeys (Saimiri boliviensis). For both species, high levels of harassment potential significantly increased both beggar harassment and sharing by the owner. Food defensibility did not affect harassment or sharing. Interestingly, squirrel monkeys and chimpanzees shared equally frequently with conspecifics despite a much higher natural sharing rate in chimpanzees. These results suggest that harassment can play a significant role in primate food sharing, providing a simple alternative to reciprocity. The selfish nature of harassment has implications for economic, psychological and evolutionary studies of cooperative systems.