Temperatures are expected to peak at 34C today, the hottest June day since 1976 and then drop off with the arrival of thunderstorms.
See also: Why trains get delayed in hot weather
Forecasters are predicting torrential downpours through to early Thursday morning with 40mm of rain expected to fall in an hour in some places.
The storms will bring the longest heatwave since 1995 to an end and mark the end of what is likely to be one of the hottest months since records began in 1847.
Laura Paterson, Met Office chief forecaster, said: "Temperatures will peak on Wednesday at 33 and 34 in places.
People cool off in the sea
Sunbathers lie on the grass in Hyde Park, London
"There will be torrential downpours and hail in places from Wednesday morning to Thursday and this will see temperatures begin to come down.
"The weekend is relatively unsettled, with more rain likely but there will be a fresher feel from Thursday."
However it's good news for festival-goers heading to Glastonbury.
Semia Elahcene cooling off in a fountain in Birmingham
Sofia Elahcene-Mantack cooling off in a fountain in Birmingham
Sunbathers occupy deck chairs in Hyde Park
Met Office spokesman Oli Claydon added: "Glastonbury will get away with it as the south west is likely to remain dry."
The storm will move in from the west to affect parts of southern Scotland and northern England from the early hours of Wednesday.
The heatwave will soon be coming to an end
More extensive thunderstorms may then break out over a larger part of England and Wales from late Wednesday afternoon onwards into Wednesday night, leading to torrential downpours, frequent lightning and a chance of hail.
This could result in some disruption, more likely from late Wednesday afternoon, which may include sudden localised flooding of transport routes, homes and businesses.
The environment agency has not put any areas on flood alert.
Thunderstorms are forecast on Thursday
Mrs Paterson added: "Rain over northern England early on Wednesday may locally lead to 20mm or 30mm of rain falling in one or two hours.
"Thunderstorms developing from late Wednesday afternoon bring a greater threat of severe weather with associated torrential downpours giving as much as 30mm or even possibly 40mm in an hour in places.
"Note that areas of severe weather are not expected to occur at the same time across the whole warning area.
"Instead, the threat of heavy rain and thunder is initially confined to parts of northern England before the threat of severe weather becomes more extensive later on Wednesday."
During the heatwave two people have died after reportedly getting into difficulty while cooling off in the water.
A teenage boy drowned in a reservoir at Greenbooth Reservoir, a moorland beauty spot outside Rochdale, Greater Manchester, after reportedly getting into difficulties while swimming in the hot weather.
A woman in her 80s also died after being pulled from the sea at East Wittering beach in West Sussex on Monday afternoon, Sussex Police said.