Firefighters on the Spanish island of Tenerife scrambled on Friday to contain a devastating fire, described as the most complicated in the Canary Islands in 40 years, after it blackened forests, prompted lockdowns and forced thousands of people to evacuate.

More than 4,500 people have been forced to flee their homes since the blaze began to spread early on Wednesday in a wooded and mountainous region in the island’s north, where firefighters and troops from the Spanish armed forces have been struggling to limit the spread of the flames and divert them away from nearby settlements and homes.