Sexual selection has a critical role in evolution, and it is fundamental to identify what ecological factors drive its variation. Disentangling the ecological correlates of sexual selection over the long term, however, is challenging and has rarely been done in nature. We sought to assess how demographic changes influenced the intensity, direction and form of sexual selection and whether selective pressures varied with age. We tested whether breeder sex ratio, number of competitors and age structure influenced selection differentials on horn length of wild bighorn rams (Ovis canadensis) of different age classes on Ram Mountain, Alberta. We used 21 years of data including a detailed pedigree, demographic parameters and repeated morphological measurements. Sexual selection on horn length of males of all ages was directional and positive. Selection intensity increased with the number of competitors, reflecting male–male encounter rate during the rut, but was independent of breeder sex ratio or age structure. This result can also be linked to changes in population size because the number of competitors was highly correlated to total number of sheep. This demographic effect likely arises from age-dependent mating tactics. Males aged 2–4 years are weakly competitive and experienced stronger sexual selection as they accounted for a greater proportion of all males. Selection experienced by mature males appeared independent of demography. Our study provides a rare description of the demographic determinants of sexual selection in nature.