Warnings of thunderstorms are in place across swathes of the UK after some areas saw the longest stretch of high temperatures since the 1960s.
Yellow storm warnings have been issued for much of England, Wales, parts of Northern Ireland and south-west Scotland.
There is a small chance of flooding, travel disruption and power cuts in those regions, the Met Office said.
It comes after torrential rain and lightning lashed parts of Scotland.
The yellow warning applies for Wales and the majority of England until Monday night next week.
The Met Office also warned of potential damage to buildings from lightning strikes or strong winds.
Forecaster Greg Dewhurst said the high temperatures triggering the thunderstorms could cause flooding.
“If rain is falling on places that have been quite hot and dry, and the ground is quite hard, the rain doesn’t have anywhere to go, and from that we can see flash flooding,” he added.
Thunderstorms are expected to clear overnight, while temperatures could remain above 20C (68F), he said.
“It’s still going to be warm and humid and that could then trigger some thunderstorms across parts of England and Wales through the afternoon and evening [on Thursday],” he added.
“Generally, the rest of the week remains unsettled with showers, some of them thundery and heavy, but there will still be some warm, sunny spells at times too.”
“It’s not often we get temperatures this high over several days, and that is triggering thunderstorms across parts of England and Wales.”
On Wednesday, three people died after a passenger train derailed near Stonehaven in Aberdeenshire. It is thought the train hit a landslide after heavy rain and thunderstorms.
A major incident was also declared in Fife.
The Scottish Fire and Rescue Service said it received more than 1,000 emergency calls on Tuesday night due to the severe weather.
The Environment Agency said 10 properties in Lancashire were also affected by flooding following storms.
It has issued flood alerts for certain areas in England and Scotland, which are separate from the weather warnings issued by the Met Office.
The warnings and alerts follow scorching temperatures in the UK.
The Met Office said temperatures surpassed 34C in central London for the sixth day in a row – the first time that has happened since at least 1961.
St James’s Park in the city saw a high of 34.6C.
Meanwhile, Devon and Cornwall Police warned the south west of England is “full to capacity”, leading to “unprecedented demand” for 999 services.
The force said it saw an increase in anti-social behaviour and public order offences on Saturday and Sunday.
Assistant Chief Constable Jim Colwell said the weekend’s events, spurred on by the hot weather, had forced officers to attend a “plethora of different incidents”.
And in Sussex, more homeowners had water supplies cut off or restricted on Wednesday. At least 300 householders had already been without tap water since Friday.
Steve Andrews, head of central operations for South East Water, said more than 150 million litres of extra water were being pumped into the network as the UK heatwave continues.