On Sunday afternoon, the weather agency had warnings of high temperatures in place across 17 Spanish regions.
On Friday, the city of Jaén in Andalucía, southern Spain, recorded a temperature of 40.3 degrees Celsius.
In a tweet, the Spanish weather agency said that, in the case of Jaén, temperatures were up to 16 degrees Celsius (60.8 degrees Fahrenheit) higher than the average for the time of year.
In the rest of the peninsula temperatures were at least 7 degrees Celsius (44.6 degrees Fahrenheit) higher than the normal average, the agency added.
An AEMET spokesperson, Ruben del Campo, said: “This episode is very unusual for mid-May and could be one of the most intense episodes in the last 20 years.”
The early hours of Saturday morning were “extraordinarily warm” for the time of year across much of the center and south of Spain, according to AEMET.
In many places, temperatures in the early morning did not drop below 25 degrees Celsius (77 degrees Fahrenheit) — something the weather agency said “is practically unheard of in the peninsula in May.”
AEMET also said that the city of Segovia had experienced its first ever “tropical night” in May, defined as a night where temperatures do not fall below 20 degrees Celsius (68 degrees Fahrenheit).