Standing genetic variation in fitness-related traits is critical to determine how fast populations can adapt to climate warming but is unknown for many species. Here we show that heritable genetic variation in heat tolerance in reef-building coral populations is widespread and strongly associated with selective pressure imposed by marine heatwaves. Our findings suggest that coral populations may be adapting to warming consistent with recent increases in their upper thermal limits.