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.”