ABSTRACT Climates are changing rapidly, demanding equally rapid adaptation of natural populations. Whether sexual selection can aid such adaptation is under debate; while sexual selection should promote adaptation when individuals with high mating success are also best adapted to their local surroundings, the expression of sexually selected traits can incur costs. Here we asked what the demographic consequences of such costs may be once climates change to become harsher and the strength of natural selection increases. We investigated how an evolutionary history of strong postcopulatory sexual selection (sperm competition) affects male fertility under acute adult heat stress. Harnessing the empirical potential of long-term experimental evolution in the seed beetle Callosobruchus maculatus , we assessed the thermal sensitivity of fertility (TSF) in replicated lines maintained for 68 generations under three alternative mating regimes manipulating the opportunity for sexual and natural selection. We find that males evolving under strong sexual selection suffer from increased TSF, and that male success in sperm competition (P2: sperm offense) is genetically correlated to increased TSF. Interestingly, females from the regime under strong sexual selection, who experienced relaxed selection on their own reproductive effort, had high fertility in benign settings but suffered increased TSF, like their brothers. This implies that female fertility and TSF evolved through genetic correlation with reproductive traits sexually selected in males. Paternal but not maternal heat stress reduced offspring fertility with no evidence for adaptive transgenerational plasticity among heat-exposed offspring, indicating that the observed effects may compound over generations. Our results suggest that trade-offs between fertility and traits increasing success in postcopulatory sexual selection can be revealed in harsh environments. This can put polyandrous species under increased risk during extreme heat waves expected under future climate change. IMPACT STATEMENT How will populations respond to a warming world? Of increasing concern are negative effects of elevated temperatures on fertility, which in many species are observed for temperatures substantially lower than the ones causing death. Incorporating knowledge on species-specific thermal fertility limits has improved estimates of current species’ ranges but renders a more pessimistic view of the potential for adaptive responses under climate change. Sexual selection is a process that can interact with thermal sensitivity of fertility and is strongest in males of polyandrous species, in which females mate multiply and sperm of multiple males compete for fertilization of female eggs. Therefore, males of polyandrous species often invest heavily in sperm competition. However, given finite resources, increased investment in sperm competition can come at an expense of other processes needed to maintain the integrity of the male germline, which when compromised can reduce fertility and offspring quality. How may such male investment, fuelled by sexual selection, affect species responses to climate warming? To address this question, we first evolved populations under different laboratory settings that independently manipulated the levels of natural and sexual selection. We exposed adults from these populations to acute heat stress and measured the fertility of males and females. We find that sexual selection on males leads to a fertility debt that is revealed under heat stress. This debt was also apparent in females, who themselves were not selected for increased reproductive investment. Thus, genes under sexual selection in males seems to have impaired fertility in both sexes under heat stress. Forecasts of species response to climate change that do not incorporate thermal fertility limits and sexual selection may therefore underestimate species vulnerability to increasing temperatures.