The Scottish Fire and Rescue Service were called to Scarista Beach just after 3.30pm on Wedneday.
Two appliances were sent to the scene, one from Tarbert and one from Leverburgh.
Scottish Ambulance Service and a doctor were also called to the scene along with Police Scotland and the coastguard.
The boy had been digging a hole in the sand which collapsed around him, resulting in him being stuck up to his neck in sand.
Firefighters, with assistance from paramedics, began digging around the boy in attempts to free him.
Due to the pressure, the boy was having difficulty breathing and he was given oxygen whilst crews continued to dig.
After a short time they were able to free him and thankfully he was able to breathe on his own. He was then placed in the care of paramedics before being flown to hospital by Rescue 100 coastguard helicopter from Stornoway.
Group Manager John MacDonald said: “This incident was an excellent example of close multi-agency partnership working between the four emergency services.
“Crews responded very quickly and thankfully were able to release the young man and ensure a successful and happy ending.”
He added: “We encourage the public to go out and enjoy the wonderful outdoors of the Highlands and Islands of Scotland, but remind everyone to do so with safety in mind.”