Hundreds of visitors were evacuated from Edinburgh Zoo after a torrent of water tore down the wall of the Visayan warty pig enclosure.
Traffic Scotland issued a series of warnings after motorists were left stranded in their cars for up to two hours.
The Met Office said about 22mm of rain fell across the capital in just four hours yesterday – half the average 50mm rainfall for the whole of May.
Minutes after the most intense rainfall, the Scottish Fire and Rescue Service said they quickly received calls from homeowners and members of the public.
Properties in Stockbridge, Leith and Craiglockhart in the capital were amongst those affected, reporting flooded roofs and ceilings.
Blocked drains across the city also caused a problem.
Flash floods at zoo
Visitors to Edinburgh Zoo spoke of their shock after a flash flood caused staff to close attraction and escort people off the premises.
On Twitter, one visitor, Kiki, wrote: “Walls have collapsed in the zoo. Frightening.”
Ross Delany added: “Torrential rain in Edinburgh, thunder and lightning, water streaming through the zoo, parts totally flooded.”
Zoo staff continued to patrol the premises into the night in case of further flooding.
Deborah Newman, Head of Business Operations & Visitor Services, said: “Late this afternoon a severe fluke flash flood occurred at Edinburgh Zoo, with an extraordinary flow of water coming down the hill.
“As a precaution we immediately closed the zoo, and visitors were escorted out of the zoo.
“The bottom wall of the warty pig enclosure did collapse during the extreme flood as an incredible volume of water backed up out of a drain and pooled heavily against the wall. All visitors and animals were quickly moved to safety and there was no harm to anyone concerned thanks to the quick thinking of our dedicated Zoo staff.”
The zoo confirmed that no animals had escaped during the floods, adding that “all animals were secure at all times”.
Marathon hit by rain
Runners in the Edinburgh Marathon were also affected by the flooding, with one runner Nicola Crowther joking on Twitter: “Only had one thunderstorm to contend with.”
Police were forced to help move traffic after flooding caused the A90 to close from Scotstoun to Edinburgh.
One affected motorist, Nial McKim, 22, from Edinburgh said: “I was driving back from taking my three-year-old nephew to Deep Sea World and I managed to drive over the Forth Road Bridge before we got stuck.
“It took us an hour and half to drive 150 metres. You could see clogged drains beside the Cramond Brig and there was about 2ft of water.
“There was police officers there to try to move the traffic on. I’ve never driven in weather like it.”
Pete Boyd, assistant manager at the Miller and Carter restaurant in Cramond Brig, said: “It has completely flooded outside. We have had customers calling to say they have been stuck in their cars for two hours.
“There are police here who are stopping the traffic each way and directing people through. One customer’s car engine was completely flooded.”