It came as a new UK record temperature of 40.3C was provisionally recorded at Coningsby in Lincolnshire, beating the previous high of 38.7C in Cambridge three years ago, by 1.6C.
If confirmed, the new Scottish record, recorded south of Duns in the eastern Borders, would be nearly 2C above the previous maximum, of 32.9C, at Greycrook, near St Boswells in the central Borders in 2003.
Other highs announced by the Met Office on Tuesday included 32.3C at Eskdalemuir in Dumfries and Galloway, 31.2C at Threave in Dumfries and Galloway, 30.9C at Aboyne in Aberdeenshire, 30.2 at Leuchars in Fife and 30.1C at Gogarbank in Edinburgh.
Meantime, the agency had issued a yellow warning for thunderstorms across the eastern Borders, Northumberland and Yorkshire for 4pm-8pm on Tuesday.
The warning stated: “Whilst many places will remain dry and hot through this afternoon, isolated thunderstorms are expected to develop across northern England and far south east Scotland.
"These will move quickly north with frequent lightning and the potential for localised, but very strong winds with gusts of 60mph are possible.
"Any heavy rain is expected to be short lived.”
Trains between Scotland and London on the west coast main line were suspended by Avanti West Coast after overhead cable damage and a fire.
All LNER and other trains on the east coast main line between York and London had already been cancelled in advance because of the heatwave.
Avanti warned passengers: “Extreme Heat: All services stopped. Do not come to the station.”
The move followed its trains between Glasgow, Edinburgh and London being slowed down from their normal 125mph maximum to as low as 30mph in places because of the extreme heat on Tuesday – adding one hour to journeys.
Its Edinburgh services only ran as far as Wolverhampton.
An Avanti spokesperson said: “Due to the extreme heat causing multiple incidents across the network, all Avanti West Coast services have now been withdrawn for the rest of today.
“In the past few hours, we’ve experienced a number of infrastructure issues including overhead line damage at Quintinshill [near Gretna] and a lineside fire at Harrow on the approach to London.”
The spokesperson said before the service suspension, the frequency of trains from Glasgow to London had remained roughly the same as normal, but “journey times were extended as a result of our trains having to run at much slower speeds”.
ScotRail reported delays of up to 15 minutes on 12 routes across the country because of speed restrictions due to the heat in force until 8pm.
Worst affected was the secondary Edinburgh-Glasgow route via Shotts, while a 20mph limit was imposed on the line between Finnieston near the SEC and Hyndland in the west end of Glasgow for the rest of Tuesday to protect the overhead electric wires which power trains, which can sag in the heat.
Network Rail, which runs the tracks, said it typically introduced blanket speed restrictions on a line when local forecast air temperatures hit 35C-36C, with rail temperatures often rising 20C above air temperatures.
It said speed restrictions were introduced because slower trains exerted less force on tracks and reduced the risk of a rail buckling, which could cause a train to derail.
The rail temperature reached 51C on the main Edinburgh-Glasgow line at Winchburgh in West Lothian on Monday.
UK transport secretary Grant Shapps said Britain’s transport network could not cope with the extreme heat, stressing the Victorian-era infrastructure "just wasn't built to withstand this type of temperature".
Cooler temperatures are forecast for Wednesday, with 23C in Edinburgh, 20C in Glasgow and 15C in Lerwick.
NHS Greater Glasgow and Clyde reported “very few” extra patients at emergency departments due to the hot weather.
Jacquie Campbell, chief officer acute services for NHS Lothian, said: “If you suspect someone has heatstroke and has fast breathing or shortness of breath, a seizure, loss of consciousness or is not responsive, please call 999 immediately or go to your nearest accident and emergency department.”
A two-day Met Office amber warning for extreme heat for southern Scotland and the east coast as far north as Perth and Dundee was due to continue in force until the end of Tuesday in the first warning of its type in Scotland.
However, the system was only introduced last year, after the June 2018 heatwave in which the Scottish temperature record was nearly surpassed.
Amid the sweltering heat, a major incident was declared in London in response to a surge in fires across the city.
London Fire Brigade battled "several significant" incidents amid an "unprecedented" challenge to crews.
The record heat came after the UK endured its warmest night on record, with temperatures remaining in the mid-20s in some places.
Met Office chief scientist Professor Stephen Belcher warned temperatures would get more extreme in the future, and the only way to stabilise the climate was to cut greenhouse gas emissions to net zero.
Nigel Arnell, professor of climate change science at the University of Reading, said the hot, dry and windy conditions meant the smallest spark could set off a fire.
He warned: "Climate change is increasing fire danger across the UK and we need to be prepared for it."
Nine people have died or are feared dead in accidents in open water since Saturday, including several teenagers, and a swimmer who was missing at sea after an incident close to Clacton pier in Essex on Tuesday.