Contradictory findings have been reported on the relation between social anxiety and the cortisol response to social evaluation in youth. The present longitudinal study aimed to clarify this relation by taking pubertal development into account. Data were collected in two waves, two years apart, for a community sample of 196 participants, aged 8-17 years at Time 1. Pubertal development and social anxiety were assessed with self-report questionnaires. Salivary cortisol was obtained before and after participants completed the Leiden Public Speaking Task. Data were analyzed using regression analysis with clustered bootstrap. The dependent variable was the cortisol area under the curve. Social anxiety and pubertal development scores were decomposed into between- and within-participants components. Between participants, the relation between social anxiety and the cortisol response to public speaking varied with pubertal development: socially anxious individuals showed higher responses at low levels of pubertal development, but lower responses at high levels of pubertal development. Within participants, an increase in social anxiety over time was associated with a lower cortisol response. The results are in line with the suggestion that the responses of socially anxious individuals change from elevated in childhood to attenuated in adolescence and adulthood. Attenuation of the cortisol response is explained by theories proposing that the stress response changes with the duration of the stressor.