The Met Office's highest warning covers an area including London, Manchester and York on Monday and Tuesday.
It means there is a risk to life and daily routines will need to change.
Speed restrictions are likely on railway lines, some schools will close early and some hospital appointments will be cancelled.
On the roads, gritters are planning to spread sand to reduce melting, and the RAC has warned more drivers will need help as cars overheat.
On top of the Met Office warning, the UK Health Security Agency issued its highest level four heat alert to health and care bodies - warning illness and death could occur "among the fit and healthy".
NHS leaders on Friday evening warned there would be greater demand for ambulances and patients could be at risk if left outside hospitals in emergency vehicles in hot weather.
In a letter they said ambulances should not wait outside emergency departments more than 30 minutes before offloading patients.
It is the first time a red heat warning has been issued for parts of the UK, although the extreme heat warning system was only introduced in 2021.
Downing Street said the alert was being treated as a national emergency. Officials met on Friday and will meet again during the weekend to discuss the response.
The weather at the start of next week is forecast to be warm across the UK but temperatures will be more like 30C in Scotland and Northern Ireland, rather than the high 30s predicted in parts of England and Wales.
The heatwave - originating in north Africa - is spreading across Europe and has fuelled wildfires in Portugal, France and Spain.
Met Office spokesman Grahame Madge said it was "potentially a very serious situation", with a 50% chance of temperatures reaching 40C - likely along the A1 corridor, running from London northwards towards Yorkshire and the North East.
The highest recorded temperature in the UK was 38.7C in Cambridge in 2019 and BBC Weather presenter Matt Taylor said there is now a realistic possibility of hitting 40C in the UK.
"That is exceptionally hot, the sort of temperatures that if you are on holiday you may be able to deal with but in day-to-day life it can have severe impacts on health," he said.
As the body gets hotter, blood vessels open up. This leads to lower blood pressure and makes the heart work harder to push the blood around the body.
This can cause mild symptoms such as an itchy heat rash or swollen feet as blood vessels become leaky.
At the same time, sweating leads to the loss of fluids and salt and, crucially, the balance between them in the body changes.
This, combined with the lowered blood pressure, can lead to heat exhaustion.
Night-time temperatures in some areas will not drop below 25C but they are likely to start cooling off from Wednesday.
Met Office CEO Penny Endersby said the extreme heat forecast was "absolutely unprecedented" and she urged people to take the warning as seriously as a red or amber warning for snow or wind.
People in the UK are used to treating hot weather as a "chance to go and play in the sun" but "this is not that sort of weather", she said.
In England, there were 2,500 excess deaths in the summer of 2020 due to hot weather, and the Red Cross predicts that heat-related deaths in the UK could treble in 30 years.
People are being urged to stay hydrated, look out for vulnerable people, keep curtains closed and stay out of the midday sun.
There have been concerns about pressure on the NHS during the extreme weather. Downing Street said contingency plans were in place and the prime minister was being updated.
The world has already warmed by about 1.1C since the latter half of the 18th century, and experts predict that temperatures will keep rising unless governments make steep cuts to emissions.
Seven of the top 10 hottest days in the UK have been since 2003, Mr Taylor said.
The latest heatwave has brought warnings of disruption to travel with rail firm Avanti West Coast warning that weekend services might be cancelled at short notice, with amended timetables and extended journey times expected on Monday and Tuesday.
It said customers should only travel "if absolutely necessary" early next week.
Network Rail said the impact to train services would "vary by region, but journeys will take significantly longer and there is a likelihood of cancellations, delays and last-minute alterations".
Transport for London has also urged people in the capital to only travel for "essential journeys" - and warned there may be some impact to Tube and rail services.
Meanwhile in sport, five horse race meetings have been cancelled on Monday and Tuesday because of the forecast temperatures.
Met Office issue red warning for extreme heat
Why is it so hot (in under 60 seconds)?