It was a day when thermometers were put through their paces, reaching heights never seen before in some places and working overtime in others.

Yesterday saw the hottest day of the year so far across Scotland, while Edinburgh experienced its warmest day since records began as the height of the summer heatwave arrived in force.

But while some sweltered in offices, shops and factories, for those who could it was the chance to get out and enjoy balmy climes more often seen on the Mediterranean coast.

Many swarmed to Portobello beach to take advantage of a cooling dip, while in Glasgow parks and shady green spaces became magnets for sunseekers and families enjoying the sun.

READ MORE: Climate crisis ‘raises risk’ of more intense heatwaves

A temperature of 31C (87.8F) was recorded in the capital in the afternoon, breaking a record which had stood
since 1975.

This was the highest temperature ever recorded in Scotland in July – while in England, London and Essex baked in 37.7C.

Met Office Forecasters said the new July record outstripped the previous high for the month of 36.7C (98.06F) set at Heathrow in July 2015.

It makes Thursday the second hottest UK day ever, beating the 37.1C recorded in August 1990.

However, the sweltering temperatures could spark thundery downpours, with a yellow warning for thunderstorms issued for most of England except the south-west, and parts of Scotland from 3pm on Thursday until 4am on Friday. The storms could lead to flash flooding, disruption of train and bus services and even power cuts.

Experts at the Met Office say the current weather pattern is driving hot air from the south, and some areas experienced a “tropical night” on Wednesday night, with the temperatures staying above 20C in spots such as St James’s Park, central London, Wattisham, in Suffolk, and Cromer, in Norfolk.

The Met Office said high pressure over eastern Europe and Scandinavia, combined with the position of the jet stream, was funnelling hot air from Europe which had originated in North Africa.

People are being urged to take precautions against the heat, including staying hydrated, staying inside at the hottest time of the day, avoiding exercise and wearing loose, light clothing.

Medical experts are warning that few lessons have been learned from last year’s heatwave, and few hospitals are prepared for the impact of intense heat.

Nick Scriven, president of the Society for Acute Medicine, said NHS workers were “struggling”, with “overheated and exhausted staff” at greater risk of making errors. “Last year, hospitals hired in large fans and coolers for a week or so but have got nothing long-term in place – they are purely reactive not proactive,” he said, adding that there was often little in place for staff to get fluids onwards.

CLIMATE FOR CHANGE: All of the latest stories on the environment

Meanwhile, doctors are advising people in Glasgow to remember to take care in the sun, particularly the very young, the very old and those with chronic diseases. A spokesman said it is not just sunburn, dehydration and hayfever which people need to be mindful of, but also respiratory problems, particularly the elderly.

Dr Emilia Crighton, NHS Greater Glasgow and Clyde’s deputy director of public health, said: “A number of Scottish people are fair-skinned and need to take adequate steps to ensure their skin is protected. As the weather forecast is for sunshine over the next few days everyone should take a few simple precautions.

“Children are especially vulnerable and care should be taken to ensure they are covered up adequately. Babies, in particular, need to be covered up. With both sun-creams and sun protection clothing designed for babies and children there is no need for children to be over-exposed to the sun.”

Charity Age Scotland, which campaigns on behalf of the elderly, urged people to look out for their older relatives and neighbours, who are particularly vulnerable to high temperatures.

Michelle Supple, director of charity services, said: “We would encourage everyone to check on older neighbours, friends and family to make sure they are doing well and see if they need anything. Something as simple as helping open a window or popping to the shops to pick up some sunscreen can make a huge difference to someone’s comfort and wellbeing.”

A Scottish Government spokesman said: “We would of course advise sensible precaution in all extreme weather conditions, and recommend people monitor and act on any weather warnings from the Met Office.”