In years with hotter weather pupils are likely to perform less well in exams, says a major study from researchers at Harvard and other US universities.
There is a "significant" link between higher temperatures and lower school achievement, say economic researchers.
An analysis of test scores of 10 million US secondary school students over 13 years shows hot weather has a negative impact on results.
The study says a practical response could be to use more air conditioning.
Students taking exams in a summer heatwave might have always complained that they were hampered by the sweltering weather.
But this study, from academics at Harvard, the University of California Los Angeles (UCLA) and Georgia State University, claims to have produced the first clear evidence showing that when temperatures go up, school performance goes down.
Researchers have tracked how secondary school students performed in tests in different years, between 2001 and 2014, across the different climates and weather patterns within the US.
The study, published by the US National Bureau of Economic Research, found that students were more likely to have lower scores in years with higher temperatures and better results in cooler years.
This applied across the many different types of climate - whether in cooler northern US states or in the southern states where temperatures are typically much higher.
The study, Heat and Learning, suggested that hotter weather made it harder to study in lessons in school and to concentrate on homework out of school.
Researchers calculated that for every 0.55C increase in average temperature over the year, there was a 1% fall in learning.
Colder days did not seem to damage achievement - but the negative impact began to be measurable as temperatures rose above 21C.
The reduction in learning accelerated once temperatures rose above 32C and even more so above 38C.
Joshua Goodman, associate professor at the Harvard Kennedy School of Government, and his co-authors provide evidence that the "heat's disruption of instruction or homework time is responsible for the observed drop in test scores".
He says students were incrementally more likely to be "distracted, agitated and find it harder to focus".
Mr Goodman says the findings also raise bigger questions about whether climate change and global warming will have implications for school achievement.
Mr Goodman says the researchers also want to examine the long-term consequences of a hot year on a cohort of students.
If students happen to take important exams in a heatwave year, does that mean they are more likely to miss out on exam results and university places?
Mr Goodman says that policymakers and parents have under-estimated the significance of temperatures in schools and overheated classrooms.
"Teachers and students already know it's a problem - because they've had to live it," he said.