On Sunday afternoon, the weather authority had warned of high temperatures in 17 Spanish regions.
According to Reuters, people in the south of the country “waved fans, drank water and splashed themselves at fountains” on Saturday as the heatwave swept the region.
On Friday, the city of Jaén in Andalusia, southern Spain, recorded a temperature of 40.3 degrees Celsius.
In a tweet, the Spanish weather agency said temperatures in the case of Jaén were up to 16 degrees Celsius above the average for the season.
Across the rest of the peninsula, temperatures were at least 7 degrees Celsius (44.6 degrees Fahrenheit) above normal averages, the agency added.
An AEMET spokesman, Ruben del Campo, said: “This episode is very unusual for mid-May and could be one of the most intense episodes of the past 20 years.”
According to AEMET, the early hours on Saturday morning were “exceptionally warm for the time of year” in much of central and southern Spain.
In many places, early morning temperatures did not drop below 25 degrees Celsius, which according to the weather service “is practically unknown on the peninsula in May”.
AEMET also said the city of Segovia experienced its first “tropical night” in May, defined as a night when temperatures do not drop below 20 degrees Celsius (68 degrees Fahrenheit).
Several countries around the world have recently experienced major heatwaves, including India and Pakistan, as well as parts of the United States — like the drought-stricken Plains and Texas, when temperatures hit 90 degrees Fahrenheit this month.