A major incident has been declared in Fife after torrential rain and thunderstorms battered parts of central and eastern Scotland overnight.
Emergency services said 28 people were rescued after a landslide at Pettycur Bay Holiday Park.
Caravans were evacuated and 218 people spent the night in emergency accommodation.
It comes as three people, including the driver, were killed after a train derailed near Stonehaven.
It is thought the 06:38 ScotRail service from Aberdeen to Glasgow Queen Street hit a landslide.
Six people have been taken to hospital but their injuries are not thought to be serious.
Across Scotland, homes were flooded and many schools were closed on the day they were due to reopen after lockdown.
The Scottish Fire and Rescue Service said it received more than 1,000 emergency calls overnight due to the severe weather.
Among them were multiple reports of flooding in Perthshire and North Lanarkshire.
ScotRail said lightning strikes had also caused power outages and disruption across the network.
It also led to major disruption on the transport network and to broadband connection issues.
In Fife, the Local Resilience Partnership (LRP) was activated following a number of incidents across the region.
As well as the incident at Pettycur Bay Holiday Park, police, fire and council services dealt with flooding issues in Freuchie, Cairneyhill, Cardenden, Kinglassie, Culross and Lochgelly.
A number of people were evacuated from their homes and staff at Victoria Hospital in Kirkcaldy discovered their cars under water when the site car park flooded.
Roads in Fife, Aberdeenshire and Perthshire were closed, while rail services were also disrupted.
In Stonehaven town centre, streets were under more than a foot of water, with the owners of a local fish and chip ship saying they were "devastated" at being flooded for the fourth time in nine years.
A number of residents in Aberdeen became trapped by the rising water and had to be rescued by dinghy.
The basement of the Carron Fish & Chip Bar is completely under water. The owners say they are “devastated”. It’s their fourth flood in 9 years. They say £10-15k worth of stock will be lost and closure for a number of weeks will be inevitable. pic.twitter.com/fDvub9D8ns— Ben Philip (@BenPhilip_) August 12, 2020
In Reddingmuirhead, near Falkirk, a family home was badly damaged after being struck by lightning.
The house lost its roof after catching fire shortly before 04:00. Residents say the family escaped unhurt but "have lost everything."
It is thought a butcher's business in the nearby village of Brightons was also hit by lightning around the same time.
A processing unit beside the butcher's shop was destroyed.
Meanwhile the Union Canal suffered a "significant breach" near Linlithgow after 80mm (3in) of rain fell between midnight and 06:00.
Scottish Canals said 30m (32yards) of embankment, 500m east of the A801 between Polmont and Muiravonside, was washed away.
More storms forecast
A Met office yellow weather warning for thunderstorms is in place from 15:00 to 21:00.
It warned that some places were likely to see "further severe thunderstorms", but with "significant uncertainty in location and timing".
The warning covers southern, central and northern Scotland.
Meanwhile, Sepa issued flood warnings for Aberdeenshire, Dundee and Angus and Tayside.
Bear Scotland said the Old Military Road in Argyll would close overnight for a third night due to weather warnings. A diversion via the A83, A82, A85 and A819 will apply from 21:00 until an inspection at first light.