At least three people died and another 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, Emiliano Garcia-Page, 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.
Police announced on Monday afternoon that the body of a man in his 50s was found near a river in the town of Camarena, also in the province of Toledo.
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 an AFP 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.
- 'Behave with caution' -
On Sunday residents of the Madrid region received an emergency text in Spanish and English accompanied by a loud alarm urging them not to use their vehicles and stay at home due the "extreme risk of storms".
It was the first time the authorities had used this mobile phone alert system.
Several theatres closed early on Sunday, and the day's football match between Atletico Madrid and Sevilla was suspended.
A number of metro lines were closed in Madrid during the morning rush hour on Monday due to flooding caused by heavy overnight rains, although by the mid-afternoon they were all open again.
High-speed rail links between Madrid and the southwestern region of Andalusia and the east coast region of Valencia, which closed on Sunday, reopened on Monday although trains were running at slower speeds in some sections, railway operator Renfe said.
The heavy rainfall eased on Monday morning. Aemet lowered its alert level for the Madrid region to yellow from a maximum red alert on Sunday.
Spanish Prime Minister Pedro Sanchez thanked emergency services for their work and urged people to "continue to behave with caution".
The torrential weather comes after Spain -- which has endured three years of scant rainfall that has prompted some regions to impose water use restrictions -- endured an intense heatwave and persistent high temperatures in August.
Scientists warn that extreme weather such as heatwaves and storms is becoming more intense as a result of climate change.