The weekend storm affected almost the whole country, with the heaviest rains recorded on Sunday in the coastal provinces of Cadiz, Tarragona and Castello, according to state weather office Aemet
Two people died and three were missing on Monday after heavy rains lashed drought-hit Spain, triggering flash floods that closed Madrid metro lines and high-speed rail links.
The weekend storm affected almost the whole country, with the heaviest rains recorded on Sunday in the coastal provinces of Cadiz, Tarragona and Castello, according to state weather office Aemet.
Two people died in the central province of Toledo as a result of the storm, the head of the regional government of Castilla La Mancha said, without giving details.
Spanish media said a man was found dead by police during a rescue attempt on a road near the town of Bargas, while another man died as rescuers tried to reach him in the town of Casarrubios del Monte.
Emergency services were looking for a man who went missing after his car was swept away early on Monday by a swollen river in the rural area of Aldea del Fresno west of Madrid, a spokesman from Madrid's emergency services, Javier Chivite, told public television RTVE.
Firefighters found his 10-year-old son - who was also in the car and was initially reported as missing - on Monday on top of a tree, he added.
Emergency services had rescued the boy's mother and sister earlier in the day.
"The poor boy spent the night perched in a tree," the head of the regional government of Madrid, Isabel Diaz Ayuso, told reporters.
The family, who live in the Madrid suburb of Alcorcon, were staying at a holiday home they own in Aldea del Fresno when the storm hit. They took to the road because they became alarmed by the flash flooding, she added.
Several bridges collapsed in Aldea del Fresno and torrents of water swept away many cars, according to a reporter at the scene.
Police were also looking for an 83-year-old man who was swept away by floodwaters in the neighbouring town of Villamanta, as well as for a woman who went missing in the town of Valmojado in Toledo, local emergency services said.
A helicopter was deployed to rescue people who sought safety on the roofs of their homes in Toledo.