Flash floods triggered by heavy rains swept through Jeddah on Tuesday, leaving motorists stranded and forcing authorities to shut schools and universities in Saudi Arabia's second biggest city.

Dozens of people were plucked from vehicles engulfed by floodwaters, Saudi civil defence authorities said, with intermittent heavy rainfall expected to last at least until Wednesday.

Residents posted videos on social media; one showed a convoy of official cars wading through a road which resembled a lake.

With fears of more rain, which also affected other regions of western Saudi Arabia, the education department announced that Jeddah schools would remain shut for the safety of students.

Flooding occurs almost every year in Jeddah, where residents have long decried poor infrastructure.

Floods killed 123 people in the Red Sea city in 2009, and about 10 people two years later.

An anti-corruption committee led by Crown Prince Mohammed bin Salman launched an unprecedented crackdown on the elite earlier this month, with the 2009 Jeddah floods among the topics under investigation.