A 50-year-old man has died after getting into difficulty in the sea at Aberavon Beach.
South Wales Police were called to the beach at around 4.25pm on Wednesday following a report of a man who needed medical assistance after entering the water.
HM Coastguard began CPR, and the air ambulance and paramedics from the Welsh Ambulance Service also attended.
Despite the efforts of the emergency services, the man — from Cilfrew, near Neath — was pronounced dead at the scene at 4.50pm.
A spokesperson for South Wales Police said his next of kin had been informed, and that the death is not being treated as suspicious.
The man has not been named.
It came on the hottest day of a record-breaking spell, with a red extreme heat warning bringing temperatures into the high 30s across Swansea Bay and drawing large crowds to the coast.
The same day, the UK provisionally recorded its hottest June day on record, with 36.1C reported at Gosport in Hampshire.
Earlier on Wednesday, both the police and the RNLI had urged people heading to the sea to take care, warning that the water remained dangerously cold despite the soaring air temperatures.
Anyone who gets into difficulty in the water is advised to float on their back, stay calm and control their breathing until the effects of the cold pass, and to choose a lifeguarded beach where possible.