More than 5,000 local inhabitants and holidaymakers were evacuated on Sunday night from farms, villas and camp sites after a huge fire threatened to sweep through the tourist resorts of Llanca, Rosas and Cadaques, near Girona, on the Costa Brava.
Although no casualties were reported, hundreds had to spend the night in schools and sports halls before they could return to their homes.
About 15,000 families were left without electricity and telephones. Local roads as well as the main highway and railway lines linking Figueres with the French border were cut off by flames.
Electricity supplies had been restored to most households and the railway line was reopened yesterday afternoon, although some of the local roads remained closed to allow access for firefighters.
Firefighters from the neighbouring provinces of Aragon and Lleida, as well as others from southern France, joined the local fire brigades and volunteers to fight the blaze.
They faced an added danger when gas bottles left in the camp sites exploded in the searing heat.
Fanned by winds of up to 50 k.p.h., the fire spread rapidly on two separate fronts. Aircraft and helicopters dropped tons of water on the 7,000 hectares of blazing farmland and wooded hillsides.
More than half the Cabo de Creus National Park, a valuable site housing dozens of rare specimens of plants, was destroyed.
Investigations have begun to find the cause of the fire which devastated an area only just recovering from a similar one 10 years ago.
Mr Xabier Pomes, interior minister for the Catalan government, said he believed it began when a local farmer was burning off weeds and scrub on his land, although later indications suggest it could have been the result of arson.
This year is proving to be a particularly dangerous summer for fires in Spain. Even before last Sunday's blaze on the Costa Brava, hot weather and strong winds had whipped up 18 other fires over the past week burning more than 11,000 hectares of land across the country from Leon in the north to Malaga in the south and in Mallorca.