Shortly after 18 on Wednesday, the emergency was lifted and the evacuees could return, reports the newspaper Sur. The extinguishing work continues at the same time.
Winds that change direction have made it difficult for the rescue service to work.
The fire broke out on Tuesday in Torre de la Peña, a forest area near the beach outside Tarifa. It probably started in a caravan, according to Spanish TVE. The town, with around 19,000 permanent residents, is known for strong winds and attracts many surfers.
A heat wave with temperatures of nearly 40 degrees prevails in several Spanish regions.
In France, a woman has died and nine other people have been injured, some of them seriously, in forest fires raging in the southwestern part of the country. Seven of the injured are firefighters.
More than 1,500 firefighters are fighting to extinguish a fire in the department of Aude, which is described as the largest to affect France this summer. The fire has destroyed 25 homes and continues to increase in scope.
Campgrounds and at least one village have been partially evacuated, and several roads are closed.
"All the nation's resources are mobilized", writes President Emmanuel Macron on X and urges people to be "extremely cautious".
- What is happening today is linked to global warming and to drought, says Prime Minister Francois Bayrou during a visit to Aude.