Understanding how populations respond to changes in climate requires long-term, high-quality datasets, which are rare for marine systems. We estimated the effects of climate warming on cod lengths and length variability using a unique 91-y time series of more than 100,000 individual juvenile cod lengths from surveys that began in 1919 along the Norwegian Skagerrak coast. Using linear mixed-effects models, we accounted for spatial population structure and the nested structure of the survey data to reveal opposite effects of spring and summer warming on juvenile cod lengths. Warm summer temperatures in the coastal Skagerrak have limited juvenile growth. In contrast, warmer springs have resulted in larger juvenile cod, with less variation in lengths within a cohort, possibly because of a temperature-driven contraction in the spring spawning period. A density-dependent reduction in length was evident only at the highest population densities in the time series, which have rarely been observed in the last decade. If temperatures rise because of global warming, nonlinearities in the opposing temperature effects suggest that negative effects of warmer summers will increasingly outweigh positive effects of warmer springs, and the coastal Skagerrak will become ill-suited for Atlantic cod.