Although body size can affect individual fitness, ontogenetic and spatial variation in the ecology of an organism may determine the relative advantages of size and growth. During an 8-year field study in the Bahamas, we examined selective mortality on size and growth throughout the entire reef-associated life phase of a common coral-reef fish, Stegastes partitus (the bicolour damselfish). On average, faster-growing juveniles experienced greater mortality, though as adults, larger individuals had higher survival. Comparing patterns of selection observed at four separate populations revealed that greater population density was associated with stronger selection for larger adult size. Large adults may be favoured because they are superior competitors and less susceptible to gape-limited predators. Laboratory experiments suggested that selective mortality of fast-growing juveniles was likely because of risk-prone foraging behaviour. These patterns suggest that variation in ecological interactions may lead to complex patterns of lifetime selection on body size.