Torrential rain and thunderstorms have caused flooding and travel disruption across many parts of central and eastern Scotland.
Homes in Fife, North Lanarkshire and Perthshire were flooded and the reopening of some schools after lockdown has been delayed.
Scotrail said lightning strikes had caused power outages and a train has been derailed near Stonehaven.
There are also reports of internet services being disrupted.
The Scottish Fire and Rescue Service said a train south of Stonehaven had come off the rails at 09:40 on Wednesday morning.
They are currently in attendance and there are no reports of injuries.
Police said the incident was ongoing.
Perth and Kinross, the Lothians, Forth Valley and the north east were the worst hit by overnight lightning strikes and heavy rain.
The Scottish Fire and Rescue Service said it was called to multiple reports of flooding in the Perthshire area, with many domestic properties affected.
Perth and Kinross Council said several roads in the area were still impassable due to flooding.
Thunderstorms and torrential rain caused travel chaos for people in the North-east. Many schools, which were due to open for the first time in five months, have remained closed.
The intensity of the rainfall left the drainage system on many roads in Aberdeenshire unable to cope, leading to huge pools of standing water.
A number of residents in Aberdeen became trapped by the rising water and had to be rescued by dinghy.
Several Schools, including three academies in Aberdeenshire are shut.
Dozens of rail services to and from the North-East have been cancelled.
A major clean up operation was under way in Stonehaven after streets in the city centre were flooded in the early hours. One business, the Carron Fish & Chip Bar was completely under water. The owners said it was their fourth flood in nine years and it had caused extensive damage.
Dunnottar school also said it could not reopen after lockdown after the area around the building was completely flooded and impassable even on foot.
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 the Scottish Environmental Protection Agency (Sepa) issued flood warnings for Aberdeenshire, Dundee and Angus and Tayside.
The fire service said a number of homes were flooded in Airdrie, while they were also in attendance on the M8 after the dual carriageway was badly affected by flooding between junctions five and seven.
Police were advising people to avoid the area completely as diversion routes were also becoming flooded and impassable.
A Police Scotland spokesman said: “We were made aware of flooding on the M8 between junctions 5 and 6 in Lanarkshire shortly before 4am on Wednesday, 12 August.
“No injuries have been reported and officers have assisted partner agencies.”
Fife Council said some schools, which were due to accept pupils for the first time since lockdown, had been heavily affected with power and building problems.
Glenrothes and Lochgelly high schools are closed, as are Auchtertool, Benarty Burntisland, Cardenden, Collydean, Denend, Kinghorn, Kinglassie, St Ninians, Torbain, Torryburn and Valley primary schools and their associated nurseries.
Freuchie Nursery is also closed, while Fair Isle Primary School is partially closed.
A landslide has also caused the closure of the A921 between Kinghorn and Burntisland. Police are urging motorists to use an alternative route.
Overnight flooding at Victoria Hospital car park was an unwelcome surprise for NHS staff coming off night shift.
An NHS Fife spokesman said: “Our staff have worked tirelessly overnight to manage the unprecedented flooding at our Victoria Hospital site.
“It has been mainly staff, rather than patients, that have been affected by the flooding in car parks A and B and all staff have been provided with transport to get them home safely this morning after their shift.
“A recovery effort is now under way to remove the damaged cars.”
‘Car is a write-off’
Matty Gale, from Lincolnshire, said woke up in his hotel in Falkirk to find his car under water.
He told the BBC: “I think my car is pretty much a write-off now. The water is up to the wheels. I can hear car alarms going off – the water has got into the electrics. I couldn’t get a wink of sleep last night because of how loud the thunder was and the lightning was blinding.
“I might have to get the train home.”
Several Primary schools in the Stirling Council area were left without internet access due to the impact of the storms.
The fire service control room in Edinburgh said they had received more than 500 calls through the night amid widespread thunder and lightning and torrential rain.
All flights due to land at Edinburgh Airport are being diverted or delayed.
BT’s incident management team said a major outage at an exchange in Edinburgh, caused by the weather, was affecting about 100,000 customers’ broadband on BT, EE and Plusnet in the city and surrounding area.
It was reported at 06:30 and engineers were on site working on the issue.
Highland Council said it was having “major issues” with internet and network issues following the thunderstorms.
It said the problems affecting its sites and home working access were due to the flooding of the exchange in Edinburgh.
Sumburgh Airport was closed to all arriving and departing aircraft on Wednesday morning due to the adverse weather conditions but remained open for emergency flights.
In Perth, heavy rain caused flooding which affected the city’s railway station.
ScotRail posted pictures of the water covering the tracks on social media.
Some routes were not operating trains at all.
At 09:25, ScotRail said there were no trains operating on the following routes:
- Edinburgh – Fife
- Edinburgh – Glasgow Queen Street via Falkirk High & Grahamston
- Edinburgh/Glasgow – Dunblane
- Edinburgh – West Calder
- Aberdeen – Edinburgh/Glasgow
- Aberdeen – Dyce
- Inverness – Perth