Portugal's firefighters have mastered most of the deadly forest fires in the north of the country, according to official data Thursday.
And improving weather conditions have raised hopes that they could extinguish the last of the blazes by the end of the day.
The wildfires, which sprang up over the weekend fed by crushing heat and strong winds, have killed five people, four of them firefighters. Another 90 people were injured, 12 of them seriously.
By Thursday afternoon, the rescue services recorded only four "fairly active" fires in the north of the country.
A day earlier, 3,900 firefighters were tackling 42 active fires, supported by more than a thousand vehicles and around 30 aircraft.
But overnight, the teams brought several blazes in villages in the Aveiro region covering a front of around 100 kilometres (60 miles) under control.
"We are doing everything necessary and possible to put an end to the fires during the day today, or else by tomorrow morning," the national commander of civil protection, Andre Fernandes, told the press.
Temperatures have dropped since the weekend and rain is forecast for Friday.
But there has been extensive damage in the north and centre of the country, much of it to the eucalyptus groves there.
One estimate issued Wednesday by the Copernicus observatory said at least 15,000 hectares (37,000 acres) of vegetation had been destroyed.
And data from the European Forest Fires Information System (EFFIS) said the total area hit by the recent fires came to 100,000 hectares: 10 times more than the area burnt since the beginning of summer.
As a result of the fires, Portugal will see record carbon emissions for the month of September "by a large margin", Copernicus said on Thursday.
By the weekend, the observatory predicts that smoke plumes from the fires will reach Spain and France, significantly affecting air quality in the region.
With dozens of houses also destroyed or damaged besides the dead and injured, the Iberian nation's government declared a day of national mourning for Friday.
The fires have brought back memories of the deadly blazes in 2017 which claimed hundreds of lives.
Since then, Lisbon has increased fire-prevention funding 10-fold and doubled its wildfire-fighting budget.
Yet some mayors of the worst-affected communes have complained of a lack of means to cope with the magnitude of the blazes, while the Portugal firefighters' league president Antonio Nunes has criticised the civil protection authority's response.
"When the state of alert was declared on Sunday, we believe that areas where even the slightest fire could be catastrophic should have been reinforced," Nunes told Portuguese media.
Scientists have long warned that climate change is driving longer-lasting, more intense and more frequent heatwaves, along with other extreme weather events.
UN Secretary-General Antonio Guterres, who is Portuguese himself, urged action to tackle the problem "that matches the scale and urgency of the crisis".
"From floods in Central Europe to wildfires in Portugal, weather extremes are leaving a deadly trail of destruction across Europe," Guterres wrote on X, formerly known as Twitter.
The Iberian peninsula is particularly vulnerable to global warming, with heatwaves and drought exposing the region to blazes.