Spain’s meteorological agency AEMET said the heatwave, caused by a mass of hot air coming from North Africa, had produced high temperatures up to 15 degrees Celsius above the seasonal average.
The worst-hit regions are Andalusia in the south, Extremadura in the southeast, Madrid and Castilla La Mancha in the centre and Aragon in the northeast.
Temperatures are expected to hit 39 degrees Celsius (102 degrees Fahrenheit) in Zaragoza in the northeast, 38 degrees in Seville in the south and 34 degrees in Madrid, sizzling conditions more usually seen in mid-summer than mid-May.
Heatwaves have become more likely due to climate change, scientists say.
As global temperatures rise over time, heatwaves are predicted to become more frequent and intense, and their impacts more widespread.
The Spanish health ministry urged residents to drink plenty of water, reduce physical activity and stay in cool places “as much as possible”.
Eric Solis, 32, who was visiting Madrid from the United States, said the heat was “a little bit concerning” and “not too convenient for tourists”.
“I was expecting a little bit cooler, fresher weather,” he told AFP.
The southern city of Jaén recorded a high of 38.7 degrees Celsius on Thursday, its highest temperature for the month of May since 1883 and 15 degrees Celsius above the average high for this time of the year, said AEMET spokesman Ruben del Campo.
The month of May has been “very hot, much more than normal,” he told AFP.
“In 2015 we had an exceptionally warm month of May, it broke all sorts of records, and it seemed at the that time that a similar situation could not be repeated. It has been just seven years,” he added.
Del Campo said the meteorological agency will have to wait until the end of the month to know if it is the hottest month of May of the 21st century.