Lifespan and ageing are strongly affected by many environmental factors, but the effects of social environment on these life-history traits are not well understood. We examined effects of social interaction on age-specific mortality rate in the sexually dimorphic neriid fly Telostylinus angusticollis. We found that although interaction with other individuals reduced longevity of both sexes, the costs associated with variation in operational sex ratio were sex specific: males' early-life mortality rate increased, and lifespan decreased, with increasing male bias in the sex ratio, whereas surprisingly, the presence of males had no effect on early-life mortality or lifespan of females. Intriguingly, early-life (immediate) mortality costs did not covary with late-life (latent) costs. Rather, both sexes aged most rapidly in a social environment dominated by the opposite sex. Our findings suggest that distinct reproductive activities, such as mating and fighting, impose different age-specific patterns of mortality, and that such costs are strongly sex specific.