Torrential rains on Thursday that followed a prolonged drought turned streets into rivers that swept away cars and nearly some pedestrians in towns along Spain's Mediterranean coast.

In Molina de Segura in the southeastern region of Murcia, social media footage showed a boy being flipped out of his buggy as his mother tried to push him across a flooded street. They were both pulled to safety by a bystander.

Passersby intervened to stop another family member trying to make the crossing with the buggy a second time.

In the same town, more footage showed a red car being swept about 50 meters (55 yards) down a street after a man tried to drive across the rising flood.

Heavy rainfall also hit central Spain and in and around the capital Madrid.

Earlier in the week, Spanish authorities shut down schools, universities and day-care centres as a precaution after rains left behind flooded basements and submerged cars.

While the rain has caused chaos and economic damage, they have also been welcomed by many in Spain, which had been on track to register the driest spring since records began in 1961, according to state weather agency AEMET.

Rainfall in Spain between Oct. 1 and May 23 was 27% below average for the period, according to AEMET.

Heavy rain was expected to continue on Friday. The AEMET warned of accumulated rain of 12 centimeters (5 inches) over 12 hours on Friday in the province of Castellon in the southeastern Valencia region.

Fire services in Castellon said the worst-affected areas were the towns of Benicassim, Oropesa del Mar and Cabanes. They said they had carried out three rescues and provided pumping services on 27 occasions.

Flooding in northern Italy earlier this month killed at least 13 people and left about 23,000 homeless while causing billions of euros worth of damage (Reporting by Charlie Devereux and Elena Rodriguez, editing by Inti Landauro and Mark Heinrich)