Nine of the country’s 17 regions on orange alert, the second highest level possible, Spain’s meteorological agency AEMET said.
However, temperatures remain above normal for June in all autonomous communities except Asturias and the Canary Islands.
The mercury is set to hit 41 degrees Celsius (105.8 degrees Fahrenheit) in Badajoz in the southwest, 40 in Seville in the south and 39 in Madrid, sizzling conditions more common in mid-summer than the first half of June.
The heatwave has produced temperatures between 7C and 12C higher than the average for this time of the year since it started on Saturday, said AEMET spokesman Ruben del Campo.
“This is a very unusual situation. These temperatures are not normal in mid-June,” he added.
Scientists say heat waves have become more likely due to climate change. As global temperatures rise over time, heat waves are predicted to become more frequent and intense and last longer, and their impacts more widespread.
The authorities urged residents to drink plenty of water, reduce physical activity and stay in cool places as much as possible.
The head of the regional government of Andalusia, in the hard-hit south, said the scorching temperatures were a sign that “climate change is an absolute reality”.
“In Andalusia, the consequences are very rough,” he added.
Temperatures are expected to ease over the weekend. The extreme weather, which arrived on a wave of hot air from north Africa, is headed for southwest France.
Spain also grappled with a heatwave at the end of May, with temperatures up to 15C above the seasonal average.
Last month was Spain’s hottest May since the beginning of the century.