The hottest day ever recorded in Scotland has seen temperatures hit 34.8C (94.6F) in the Borders.
The Met Office confirmed Charterhall had provisionally set the new record on Tuesday.
It surpasses the previous record of 32.9C recorded in Greycrook in the Borders on 9 August 2003.
It comes on day two of an amber weather warning for extreme heat and just hours after the UK set a new record of 40.2C at Heathrow in London.
🌡️ Charterhall in the Scottish Borders has provisionally set a new maximum temperature record for #Scotland today
— Met Office (@metoffice) July 19, 2022
The Met office warning remains in force across parts of Scotland until midnight.
A yellow warning of thunderstorms across north-east England and south-east Scotland was in place until 20:00.
Forecasters say temperatures should drop on Wednesday to more normal levels for the time of year.
Most of Scotland saw high temperatures on Monday, with Edinburgh and Aberdeenshire passing the 30C mark.
The heatwave continued overnight with a high of 20.5C (68.9F) at Dundrennen, Kirkcudbrightshire, just 0.4C off the Scottish record of 20.9 C (69.6F) registered on 26 July 2019.
And the temperatures continued to build through the morning with the mercury in the Scottish Borders rising into the low 30s by lunchtime.
Unofficial weather stations were picking up temperatures of 35-36C mid-afternoon before the 19-year record was beaten by 1.9C.
Mark Wilson, of the Met Office, said it was “officially the highest temperature recorded in Scotland since records began”.
Elsewhere in Scotland the highest temperatures were recorded at Eskdalemuir (32.3C) and Threave (31.2C), both in Dumfries and Galloway, earlier on Tuesday.
Records were broken across the UK, with barometers hitting hit 40.3C at Coningsby in Lincolnshire, at 16:00 BST.
Climate change reality
In Wales, Hawarden in Flintshire registered 36.2C, provisionally the second highest temperature on record in Wales, but below Monday’s 37.1C.
Met Office chief of science and technology Prof Stephen Belcher said exceeding 40C was “virtually impossible” in an undisrupted climate, but due to climate change “driven by greenhouse gasses” such extreme temperatures had become a reality.
He said if there continued to be high emissions “we could see temperatures like this every three years”.
The Scottish Fire and Rescue Service (SFRS) warned the wildfire risk in southern and eastern parts of Scotland had been raised to “very high”.
FRS Deputy Assistant Chief Officer Bruce Farquharson said: “At this time of year, the ground vegetation is a combination of green growth, with a relatively high moisture content, and dead vegetation lying on top, which can easily ignite and spread quickly over a large area.”
Farm workers joined firefighters in creating a fire break to extinguish a large blaze in a field at Hadden Farm near Kelso on Tuesday afternoon.
On a record-breaking day for Scotland, here’s Gillian with the forecast. pic.twitter.com/9qIuDOKp60
— BBC Scotland Weather (@BBCScotWeather) July 19, 2022
Meanwhile the rising temperatures led to ScotRail putting speed restrictions on many services, and rail bosses warned trains could be delayed because of them.
Avanti West Coast have cancelled all services for the rest of the day after multiple incidents across the network. The train company advised customers not to come to stations.
Elsewhere LNER cancelled all trains south of York and Transpennine Express was running a much reduced service
Agencies including Loch Lomond and the Trossachs National Park urged care around water, emphasising the risk of cold water shock.
The Scottish SPCA advised dog owners to only walk dogs early in the morning or late at night if cool enough