At least 27 people have died in fires which have ravaged forests in northern and central Portugal over the past 24 hours, rescuers said on Monday, as three people were killed in Spain in blazes sparked by arsonists and fanned by Hurricane Ophelia.
In Portugal, prime minister Antonio Costa declared a state of emergency as more than 4,000 firefighters fought some 20 major fires still raging on Monday.
The 27 deaths, confirmed by Portugal's national civil protection agency, came four months after 64 people were killed and more than 250 injured on June 17, in the deadliest fire in the country's history.
About 520 separate fire outbreaks on Sunday were caused by "higher than average temperatures for the season and the cumulative effect of drought, which has been felt since the start of the year", civil protection agency spokeswoman Patricia Gaspar said.
"We went through absolute hell, it was horrible. There was fire everywhere," a resident of the town of Penacova told RTP television.
Two brothers in their 40s who were from her town and were trying to help put out the blaze were among the fatalities.
California 'horror' fires burn on, 40 dead in one week
In the northwestern Spanish region of Galicia, on the Portuguese border, authorities were blaming arson for about 17 fires which have caused three deaths.
"They are absolutely intentional fires, premeditated, caused by people who know what they are doing," said Alberto Nunez Feijoo, the head of the Galicia regional government.
On Monday, the "situation remained very worrying", Mr Feijoo said, adding that firefighters along with soldiers and locals were battling the flames.
Spanish interior minister Juan Ignacio Zoido said in a tweet that "several people have been identified in connection to the fires in Galicia".
The fires were being fanned by wind gusts of up to 90 kilometres per hour as Hurricane Ophelia moved north off the coast of Spain towards Ireland, Mr Zoido told private broadcaster La Sexta.
"We have not had a situation like this in the past decade. We have never deployed so many means at this time of the year," he said.
Prime minister Mariano Rajoy, who is from Galicia, expressed his condolences to the victims in a Twitter message.
Five wildfires were raging near Vigo, Galicia's biggest city, forcing the evacuation of a shopping mall and a PSA Peugeot Citroen factory on the outskirts of the city.
The flames had reached O Castro, a large hilltop park in the heart of Vigo with sweeping views of the city's estuary, Spanish public television station TVE reported.
Images broadcast on Spanish TV showed local residents, their mouths and noses covered with handkerchiefs, trying to contain the flames with buckets and pans of water.
The city of around 300,000 residents has opened up two sports centres and booked rooms in three hotels for people who had to evacuate their homes.
At least 10 schools cancelled classes on Monday in Vigo because of the flames, local officials said.
Spain's rail operator Renfe said it had cancelled train service between Vigo and Barcelona because of the wildfires, and several roads in Galicia were closed because of the flames, local officials said.
The national weather office is forecasting rain and cooler temperatures in Galicia starting Monday, which officials hope will help put out the flames.
Meteorologists say Ophelia is the most powerful hurricane recorded so far east in the Atlantic and the first since 1939 to travel so far north.
Though Ophelia was downgraded to a storm before it hit the coast of Ireland, schools there were closed on Monday as the country braced for violent winds and rain, with the weather service warning people to remain indoors.