Hunting live prey is risky and thought to require specialized adaptations. Therefore, observations of predatory cannibalism in otherwise non-carnivorous animals raise questions about its function, adaptive significance and evolutionary potential. Here we document predatory cannibalism on larger conspecifics in Drosophila melanogaster larvae and address its evolutionary significance. We found that under crowded laboratory conditions younger larvae regularly attack and consume 'wandering-stage' conspecifics, forming aggregations mediated by chemical cues from the attacked victim. Nutrition gained this way can be significant: an exclusively cannibalistic diet was sufficient for normal development from eggs to fertile adults. Cannibalistic diet also induced plasticity of larval mouth parts. Finally, during 118 generations of experimental evolution, replicated populations maintained under larval malnutrition evolved enhanced propensity towards cannibalism. These results suggest that, at least under laboratory conditions, predation on conspecifics in Drosophila is a functional, adaptive behaviour, which can rapidly evolve in response to nutritional conditions.