Police ordered residents to flee their homes outside the town of Cadalso de los Vidrios some 80 kilometres southwest of Madrid at dawn as the flames approached, emergency services said.
“We are helping people to evacuate their homes. You can't do anything else. I feel very helpless,” Cadalso de los Vidrios mayor Veronica Munoz told private television Telemadrid.
Local officials on Saturday evacuated some 200 people from a campsite in the town.
Some 350 firefighters and soldiers backed by 14 water-dropping aircraft were battling the wildfire that started Friday evening in the central town of Almorox.
Firefighters said that temperatures approaching 40 degrees Celsius, low humidity, and high winds exacerbated the flames.
Officials said another blaze near the city of Toledo some 60 kilometres away which forced the evacuation of 22 residents had been brought under control on Sunday.
Meanwhile, a major blaze in the northeastern region of Catalonia “could be controlled by this evening,” the regional government said in a statement, adding that it would “take days” to fully extinguish it.
The fires come as Europe is hit by a major heatwave, with temperatures in some parts of France reaching record highs.
Meteorologists blame a blast of hot air from northern Africa for scorching temperatures early in the European summer, but the heatwave is forecast to die down from Sunday.