The coastguard received a emergency call from one of the children who stayed on the beach that the rest of their group was at risk of being swept out into the Atlantic from Culla Bay on the island of Benbecula
However, a surfer in the area managed to get the children to the beach, where a number of bystanders helped to move them to safely ashore.
The Maritime and Coastguard Agency (MCA) said the alarm was raised at about 3pm.
Benbecula, Lochmaddy and Lochboisdale coastguard rescue teams and Stornoway rescue helicopter attended the scene.
The Scottish Ambulance Service (SAS) and police were also alerted to the situation and the children were assessed by paramedics.
Two patients were taken to Uist and Barra Hospital following the incident, according to emergency crews.
A spokesperson for the Scottish Ambulance Service said: “We received a call at 15:15 on 5th July 2021 to attend an incident at Culla Bay, Isle of Benbecula.
“Two ambulance crews were sent to the scene and two patients were transported to Uist & Barra Hospital.”
Praising the action of the child on the beach for calling 999, HM Coastguard Benbecula said: “Well done.”
They also thanked the surfer, the Stornoway Rescue Helicopter, MRCC Stornoway, Police Scotland Highland and Islands Police Division, Scottish Ambulance Service, Uist and Barra Hospital and the bystanders who assisted.