Hundreds of firefighters backed by water-bombing planes battled a wind-fuelled wildfire in northeast Spain Monday that killed four people including a teenage girl.
Another 23 people were injured, including eight who remained in hospital, the Catalan regional government said.
About 1,300 people were battling the blaze, including 500 Spanish and 450 French firefighters plus military personnel, police and volunteers, backed by 33 planes and helicopters, said Catalonia region interior minister Felip Puig.
The fire remained out of control, he told reporters on Monday evening, but "the outlook is encouraging" because the wind had dropped and the temperature in the area was expected to do the same.
"At this stage we cannot say when it will be possible to control the fire," he said.
"The conditions are right for the firefighters to attack it overnight," he added, when the aircraft will not be able to operate.
Puig said the fire had likely been caused by a cigarette butt or small explosive device that caught fire due to "recklessness or negligence."
Among the victims, were a Frenchman and his 15-year-old daughter who died Sunday after abandoning their car and throwing themselves off a cliff into the sea to escape the approaching flames near the town of Portbou.
"From where they jumped you would have to project yourself about one metre (three feet) to reach the sea. They probably did not jump far enough and they hit the rocks below," said Portbou mayor Jose Luis Salas-Mallol.
The man's wife and their two other children were injured and taken to hospital.
A 75-year-old Spanish man died of a heart attack as he watched his house burn and a 64-year-old Frenchman died in hospital from burns suffered when his car was engulfed in flames, authorities said.
About 100 other people who also abandoned their cars on the same stretch of road walked down a steep hillside to the beach, witnesses said. Many suffered injuries ranging from burns to broken bones.
The wildfire broke out on Sunday near the town of La Jonquera and spread quickly across the Alt Emporda region near the French border, whipped on by winds of up to 90 kilometres (55 miles) an hour.
By Monday it had covered some 13,000 hectares (32,000 acres), authorities said. The smoke reached as far as Barcelona, some 150 kilometres away.
Firefighters ordered thousands of residents in 17 towns, including La Jonquera and Figueres, to remain indoors with their windows and doors shut because of the threat from the smoke and flames.
Hundreds of people spent the night in emergency shelters set up in the region, mostly in the town of Figueres, about 20 kilometres south of La Jonquera.
Officials on Monday reopened a key highway linking Figueres to the French city of Perpignan. The road had been shut twice since the wildfire began on Sunday. A high-speed rail link between Spain and France was also reopened.
Spain is at higher risk of forest fires than ever this summer after suffering its driest winter in 70 years.
The country's biggest fire so far this year ravaged 50,000 hectares in the eastern region of Valencia this month.