Phylogenetic analysis has shown that males' propensity to engage in aggressive encounters is associated with females having greater longevity. Here, we confirm the causal link between aggression and reduced longevity by looking at an egg-eating snake (Oligodon formosanus) in which females defend territories in the presence of sea turtle eggs. We monitored aggressiveness and survival at two sites: a control site with a stable supply of turtle eggs, and a second site where we collected data before and after a storm that eroded the beach on which turtles nested, thus leading to a loss of territoriality. We show that territoriality was the driver behind higher injury rates in females. Territorial females also had lower survival and decreased longevity compared with the nonterritorial males, but these differences disappeared when females were not territorial. Our study demonstrates how resource availability can influence the evolution of sex-specific patterns of survival across vertebrates.