Spain's second heatwave in less than a month dragged on Wednesday for a fifth day, with temperatures expected to top 40 degrees Celsius in parts of the country as the mass of hot air pushed into France.

Almost all of Spain was affected, with nine of the country's 17 regions on orange alert, the second highest level possible, Spain's meteorological agency AEMET said.

Temperatures were 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.

Temperatures were set to hit 40 degrees Celsius (104 degrees Fahrenheit) in Seville in the south
Temperatures were set to hit 40 degrees Celsius (104 degrees Fahrenheit) in Seville in the south AFP / CRISTINA QUICLER

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 effects 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.