The UK has seen its hottest July day and second hottest day on record as the mercury hit 38.1C, the Met Office said.

Forecasters said the new record in Cambridge 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 on record, also beating the 37.1C recorded in August 1990, Met Office figures show.

And it is possible that the all-time UK record of 38.5C (101.3F) recorded in Faversham, Kent, in August 2003, could be broken on Thursday, the Met Office said.

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, but there is “no doubt” climate change is playing a role in driving what could be unprecedented temperature highs.

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.

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 staff were “struggling” and “overheated and exhausted staff” were 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 there was often little in place for staff to get fluids on wards.

Network Rail announced that speed restrictions would be in place in the south east from midday until 8pm amid fears that tracks could buckle in the heat if trains travel too fast.

Speed limits on most commuter lines will be cut from 60mph to 30mph.

Extreme weather action teams have been “activated” to keep passengers safe and trains running, Network Rail added.

The Rail Delivery Group, which represents the industry, advised passengers in the south east to consider changing their travel plans on Thursday owing to the heat.

A study from the Met Office previously showed last year’s summer heatwave was made around 30 times more likely than it would be under natural conditions as a result of human activity driving global warming.

Dr Michael Byrne, from Oxford University, said that if Thursday became the hottest day on record in the UK it would be “hugely significant”, but just the latest in a “torrent” of temperature records being broken in the last month.

“Not only has 2019 brought the world its hottest ever June, but in recent days countries from Belgium to the Netherlands to Germany have broken their all-time heat records. It has never been hotter in northern Europe,” he said.

“Such extreme heat poses serious health risks this week as well as uncomfortable questions about how well the UK is preparing for increasingly frequent and severe heatwaves over coming decades.”

The Government’s advisory Committee on Climate Change has warned the UK is not prepared for the increase in heatwaves that is expected with global warming.