Just hours after basking in the warmest weather of the year so far, the Highlands were drenched yesterday as storms swept across the region.
The Western Isles were the wettest place anywhere in the UK as the warm conditions drew in storms off the Atlantic.
More than an inch of rain fell in Harris in just 14 hours – an unusually high figure for July.
Dramatic thunder and lightning storms were also witnessed across the Highlands, with Scottish Hydro Electric Power Distribution (SHEPD) working to a yellow alert because of the risk of power cuts.
The downpours came just hours after the warmest conditions of the year, with the mercury hitting nearly 27c in Sutherland on Tuesday.
A Met Office spokesman said the weather would remain hot – but warned that the unsettled conditions are set to stay for the next few days.
A yellow weather warning was put in place throughout yesterday and has been continued in the far north of the mainland as well as Orkney and Shetland until 9am this morning.
The Scottish Environment Protection Agency also issued flood alerts for several areas in the Highlands and islands.
Fears over lightning strikes meant the closure of part of the swimming complex at the Inverness Leisure centre yesterday morning.
The leisure waters area was closed for more than an hour because of fears that lightning striking the outdoor area of the pool could conduct electricity into the internal section as well.
A spokesman for High Life Highland said that the pool had been closed off at about 11.15am and swimmers were given the option of using the unconnected competition pool instead.
The centre reopened the leisure pool about an hour later, following 30 minutes without further lightning strikes near the complex.
Another casualty of the storms was the Highland Folk Museum which closed because of concerns about flooding and lightning strikes.
A spokesman confirmed that there had been no significant damage and that the park would open as normal today.
The highest rainfall anywhere in the country was recorded in Harris, where more than an inch (31mm) of rain fell in 14 hours from 1am until 3pm.
A Met Office spokesman said more than half the rainfall (29.4mm) occurred in a single hour between 4am and 5am yesterday morning.
Aviemore was only slightly behind over the same period with the second highest with a rainfall of 29.4mm over the 14 hour period.
Transport was largely unaffected, although signalling problems affected train travel south and east from Inverness.
SHEPD said that the bulk of the electricity failures were in central Scotland and the north-east – although they engineers on duty across the country.
Dale Cargill, director for customer operations at SHEPD, said: “We were prepared for the bad weather and our engineers have been working hard to repair customer supplies and they will remain in the worst hit areas to make sure any homes or businesses without power are restored at the earliest opportunity.
“If anybody has concerns for their own safety, or the welfare of their friends or family we would encourage them to contact us and we’ll do everything we can to help them.”
A spokesman for the Met Office said that the worst of the storms would clear the mainland overnight but said that heavy showers were likely to continue in the northern isles this morning.
Today is expected to be “generally sunny” and remaining warm, though cloud will gather from the west later on, with some rain in Argyll and Lochaber.
More heavy showers are expected on Friday, particularly in the west and central areas of the Highlands, with the whether remaining warm but unsettled throughout the weekend.