
Cardiff was the hottest place in the UK overnight, breaking the record for the warmest June night.
It was 33.3C in Bute Park in the capital on Wednesday, with forecasters predicting that Wales will see its hottest ever June day on Thursday.
Overnight temperatures in Cardiff did not drop below 23.5C, as rail passengers have been advised to travel only if "absolutely necessary" on Thursday and Friday.
Jake Kelly, from Network Rail, said the heat was putting a "significant strain" on the railways, but urged passengers to stay safe by planning ahead and staying hydrated.
South Wales Police said a 50-year-old man from Cilfew, Neath Port Talbot, died after entering the sea at Aberavon Beach on Wednesday.
Emergency services were called at about 16:25 BST where the coastguard attempted to perform CPR until the air ambulance arrived.
Despite their best efforts, the man was pronounced dead at the scene. His next of kin have been informed.
Public Health Wales has urged people across Wales to stay safe and check on family, friends and neighbours.
It has reminded people to follow water safety advice including not swimming alone, avoiding jumping into open water, supervising children, choosing lifeguarded locations, avoiding alcohol, and follow "Float to Live", external advice.
Temperatures are expected to hit 36C on Thursday, with the Met Office extending its current red extreme heat warning. It is now set to end at 23:59 on Thursday night.
More than 840 schools across Wales are closed on Thursday as temperatures could soar as high as 36C in some places.
The number of school closures in west and mid Wales continues to rise with Carmarthenshire, Ceredigion and Powys reporting a higher number of school closures on Thursday.
Four schools in Pembrokeshire have shut, while Swansea, Cardiff and Rhondda Cynon Taf councils have also seen an increase.
Mathew Evans, head teacher of Ysgol Glantaf and Bro Edern in Cardiff, called it a "momentous decision" to close but said the weather had provided a unique challenge for Wales.
"They're small classrooms, windows of limited opening and when you add 30 pupils they overheat very, very quickly," he added.
He also highlighted the difficulties faced by kitchen staff who are working in "stifling" temperatures to feed the pupils.
Evans said it was "difficult" to look at long-term solutions to the problem without an "incredible" bill.
He added: "This weather creates a problem for the whole school. It's a problem for buildings like Bro Edern and Glantaf, which are 70s-build, concrete clad, and have very narrow corridors."
Referring to Wales' heatwave in May, Gagen said it was "really unusual to have two in a row".
"Actually, for me on a personal level, as I'm walking around, it feels like the first time in my life that I can physically feel climate change.
"And it's quite frightening, actually. It's an uncomfortable experience."
Mary said the country would experience "tropical nights" caused by a "heat dome" effect.
"Each one of those events, whilst, sure, it's a feature of a heatwave and we do get heatwaves in this country, each of them has a climate change element behind it that's making it more intense," she said.
"It's preparedness, it's having cool spaces in our cities. It's having buildings that can cope with the heat.
"And we are really learning in this heat event that we are absolutely not prepared. We're seeing school closures. If you are trying to manage ill people on a ward in our hospitals that doesn't have air conditioning, you're going to find this very uncomfortable.
"So, we really have a long way to go. Our infrastructure is absolutely not prepared for this."
In response the Welsh government said it was "committed to addressing the climate emergency".
"In line our manifesto and 100-day plan, we have begun work on a new Climate and Nature Plan which will set out the actions to realise our net zero 2040 ambition, and to ensure substantive nature recovery by 2050," the statement added.

