1. Adaptive plasticity in life-history traits is often critical to maximize fitness in the face of environmental heterogeneity. For example, many organisms respond to a threat to their survival (and hence residual reproductive value) by adaptively increasing their investment into current reproduction (i.e. 'terminal investment').
2.A key to successful terminal investment is the use of adequate environmental cues to extrinsic mortality sources. In species that live at high population densities, the presence of dead conspecifics could potentially act as a reliable cue to extrinsic mortality sources (e.g. via pathogens).3. We experimentally tested this idea using the model organism Drosophila melanogaster, a pest species that experiences marked demographic shifts. We monitored the reproductive output of young mated females during repeated bouts of egg laying in the presence (i.e. dead exposed) or absence (i.e. controls) of dead conspecifics, interspersed by mating periods where dead conspecifics were always absent.4. Dead-exposed females produced more offspring than controls when in the presence of dead conspecifics but fewer offspring than controls when dead conspecifics were subsequently removed (i.e. during mating periods). These changes were repeatable across time, and are thus indicative of high plasticity in reproductive behaviour induced by perception of dead conspecifics.5. Flies responded equally to starvation-induced and flash-frozen dead conspecifics, indicating that the cause of death is irrelevant to trigger the plastic response observed, and that females respond to the presence of dead conspecifics per se.6. Finally, we found that dead-exposed females produced heavier daughters (but not sons) than controls when in the presence of dead conspecifics, but not during mating periods (when dead conspecifics were absent). In this species, body size correlates more strongly with female (than male) fitness, so higher investment in daughter weight is congruent with terminal investment. 7. Altogether, these results show that perception of dead conspecifics leads to highly plastic life-history adjustments in the form of increased investment in both the quantity and the quality of offspring. We discuss these results in the context of terminal investment and other alternative hypotheses.