Authorities said most of the victims appeared to be foreign nationals who ignored instructions to shelter in place.
The flames had spread extremely rapidly in a wooded area around the town of Los Gallardos in Almeria province, particularly affecting the nearby hamlet of Bedar, said Antonio Sanz, head of emergencies in the region of Andalusia.
He said the authorities had told residents to stay in their homes and that the deaths appeared to have occurred when people decided to try to flee in their cars.
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 on Friday.
Seven 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.
"The consequences have been terrible. Everything seems to indicate that, in the case of the dead, the majority - or all of them - are foreign nationals," Sanz said.
The circumstances resemble those in neighbouring Portugal in June 2017, when a huge wildfire during a heatwave killed more than 60 people and injured dozens more, with half of the victims burned to death in their cars as they tried to flee.
Sanz urged residents to follow official instructions and avoid taking risks as authorities focused on saving lives.
Another four people were being treated in hospital for serious burns.
Juan Manuel Moreno, head of Andalusia's regional government, told Cadena Ser radio another 19 people were still missing.
The fire was believed to have started when a power cable came loose and fell on a patch of dry scrubland, Pedro Ridao, mayor of the nearby town of Antas, told state broadcaster TVE.
Prime Minister Pedro Sanchez said in a post on X he felt "enormous sadness and devastation" over the consequences of the fire, offering his condolences to the families of the victims.
Early summer heatwaves across western Europe in May and June have parched vast areas of land, making them particularly vulnerable to wildfires in 2026.
Europe is warming at more than twice the global average, the World Meteorological Organisation has said, making prolonged heat episodes increasingly likely.
The death toll makes it Spain's deadliest wildfire since 2005, when 11 firefighters were killed in a blaze in the central province of Guadalajara that was sparked by a barbecue.