A three-year-old girl has been pulled unconscious and not breathing from the sea by a passer-by.
Swansea Coastguard said she regained consciousness and started breathing when she was transferred to an ambulance after the incident at Coney Beach in Porthcawl.
She was taken to hospital at Bridgend by ambulance.
The coastguard warned parents to keep an eye on children on the beach.
Coastguards were alerted at 1545 BST on Sunday when a member of the public made the call after spotting the girl lying on her back in the water and not breathng.
The person began performing CPR on the little girl while they waited for rescue services to arrive, and lifeguards gave her oxygen.
An RAF rescue helicopter from Chivenor in Devon was initially called to help but later stood down and the girl was taken to hospital by ambulance.
Swansea Coastguard watch manager Dai Jones said: "This little girl owes her life to the member of the public who pulled her from the sea and administered CPR, as well as the call to the coastguard and the quick response of all rescue resources involved.
"When the girl was pulled from the water she was unconscious and not breathing, but when she was transferred to the ambulance she began breathing and regained consciousness.
"We do urge parents to always be vigilant and keep an eye on their children when they are playing at the beach, especially during busy periods when they can easily get lost of wander off."