Theory predicts that males should evolve mechanisms to assess competition and allocate resources accordingly. This requires phenotypic plasticity, to accurately match responses to the environment. Plastic responses in males to sexual competition are diverse and widespread. However, our ability to understand and predict how they evolve is limited because their benefits are rarely measured, and costs are, as yet, entirely unquantified. In the fruit fly Drosophila melanogaster, males that anticipate strong competition for matings or fertilizations subsequently mate for longer and transfer more of two key seminal fluid proteins. This results in significantly elevated reproductive output. In this study, we examined the fitness effects of male responses to rivals across the entire male life span. Males were exposed to rivals or not throughout life while controlling mating opportunities. Males showed significant responses to rivals throughout their lifetimes, associated with significant early-life fitness benefits. However, these disappeared after the third mating. There were also significant costs—males exposed to rivals took significantly fewer mating opportunities in later life and had significantly shorter life spans than controls. The data suggest that there are substantial costs for males of mounting plastic responses to the threat of sexual competition.