One Spaniard was among the victims and the rest appeared to be foreigners who ignored instructions to shelter in place, said Antonio Sanz, head of emergencies in the Andalusia region.
The victims tried fleeing by car but were engulfed by flames that spread rapidly, fanned by wind, through a wooded area around the town of Los Gallardos in Almeria province, he said.
Four people, who appeared to be British because the steering wheel of their car was on the right-hand side, died in one vehicle, he said.
Eight others were found dead after apparently abandoning their cars and attempting to escape on foot along a route that was not part of the evacuation plan.
Many of the charred corpses still had to be identified through DNA testing, he said.
"The fire spread like gunpowder," Andalusia's regional leader Juan Manuel Moreno told reporters, calling the blaze "one of the quickest and most complex we've seen".
Stronger winds were expected later on Friday, he added.
Some of those missing were probably hikers caught off guard in the woods, Moreno said.
Rescue workers found several walking sticks at the scene.
The circumstances resemble those in neighbouring Portugal in June 2017, when a huge wildfire during a heatwave killed more than 60 people, with half of the victims burned to death in their cars.
A series of early summer heatwaves has left large parts of Spain parched and vulnerable to any spark, fuelling an early start to wildfire season.
So far this year, about 57,000 hectares have burned, about half the annual average for the past two decades and making up 40 per cent of all the area burned in European Union member countries, according to the European Forest Fire Information System.
"We usually don't see these fires until August. They're starting earlier now because the vegetation dries out sooner," Roman Garcia, a forest firefighter from Salamanca, said on state broadcaster TVE.
A record heatwave last August provoked the worst wildfire season in three decades, charring 330,000 hectares - an area twice the size of London.
Prime Minister Pedro Sanchez acknowledged at the time that wildfire prevention had been "clearly insufficient" and forestry management inadequate, pledging to do "whatever it takes" to ensure fires on such a scale never happened again.
Sanchez on Friday offered his condolences to the families of the victims and said he felt "enormous sadness and devastation".
As authorities sought to identify the dead and track down the missing, anxious relatives from around the world posted messages on social media and local forums.
One Irish woman said her daughter, who was driving a red Ford Fiesta and had her dog with her, was missing.
Another person from the United States said her brother had been among a group of 10 people who tried to escape through a valley next to a stream.
The blaze moved at a speed of 15km in two hours, Moreno said.
The fire was believed to have been sparked by a broken power cable that fell into a ditch next to a road.
A spokesperson for utility company Endesa contradicted that account, however, saying the cable carried no voltage.
In the village of Bedar, where almost half of the 1009 residents were British in 2022, according to official data, police went door-to-door to persuade sometimes-reluctant residents to leave as the flames approached the houses the previous day.
"They are British, Belgian residents. I have even officiated some of their weddings. I feel sadness and profound pain," Bedar Mayor Angel Collado said on TVE, pausing to compose himself.