It all started on June 23, when the team began exploring the cave system after a practice game.
Heavy rainfall began to flood sections of the cave, trapping the 12 boys and their assistant coach. They were reported missing just a few hours later and search efforts began.
Some British divers took to the caves and eventually located the team, with everyone miraculously still alive.
Upon the discovery, rescue efforts immediately began, and you can scroll down to read more about how the process of how emergency responders made it happen.
Before divers could fully rescue the boys, they first had to give them a crash course in swimming.
According to Business Insider, most (and possibly all) of the boys trapped did not know how to swim.
The outlet notes that this is not unusual for Thailand, as it is rare for children to get swimming lessons, and drowning is the leading cause of death for kids under the age of 15.
The spent days working with the boys to get them ready for the swim out.
For the escape, five Thai Navy SEAL divers and 13 foreign cave divers ran a 3-mile-long rope from the cave exit to where the boys were trapped.
They then had to fit the boys with diving gear — masks, oxygen tanks, etc. — so they could guide them through the water-filled areas.
Additionally, it was reported that prior to the rescue mission, a team of divers that included a doctor and nurse went in to check on the boys. They confirmed that none of them appeared to be suffering any serious health issues.
Once the divers were able to get the boys ready, they had to begin the 2 1/2-mile journey from where they were trapped to the exit.
The trek featured a mix of walking and diving, with the underwater sections so narrow in some areas that the rescuers had to send boys though the passage detached from their tanks but still connected to the breathing apparatus.
The divers executed a "buddy system" method on the rescue, with two divers accompanying each boy.
To prepare for the rescue, teams of responders first had to drain as much water as possible from the caves.
The early monsoon-season rainfall was the main reason the boys were trapped in the first place, so Lowering the water levels was the best chance of decreasing the odds of something going wrong.
One of the biggest hurdles for the rescue teams was impending rainfall from monsoon season.
As has been established, unexpected rainfall was the cause of cave flooding in the first place, and emergency responders had to act quickly before more rainwater impacted their rescue efforts.
As the world watched the rescues mission play out, American business man and engineer Elon Musk offered to help.
Musk and his team created a mini-submarine that can hold one child, which they intended to give to the Thailand government to help with the rescue.
The inventor shared a video of him and his team testing out in a Los Angeles pool before transportation.
Testing underwater in LA pool pic.twitter.com/CDO2mtjP2D— Elon Musk (@elonmusk) July 8, 2018
While the children were rescued prior to his arrival in Thailand, Musk still left the sub there in case it could be of future use.
BREAKING: Leader of Thailand cave rescue says medic, 3 SEALs who stayed with the boys are now out of the cave. They stopped for a photo op on the way out. pic.twitter.com/91lKVXDgWA— Hanna Battah (@HannaBattahFox4) July 10, 2018
Eventually, all the boys and their coach were rescued, with the final operation completed on Tuesday.
"Leader of Thailand cave rescue says medic, 3 SEALs who stayed with the boys are now out of the cave," tweeted ut FOX 4 Reporter Hanna Battah. "They stopped for a photo op on the way out."
Now that the boys are free, they are not fully out of the woods just yet, as they have to undergo at least a week of medical observation.
They entire team will have to be closely watched by medical professionals to make sure they don't have "cave disease" or any other dangerous infections.
Luckily, at this time there is no indication that any of the boys are suffering from any serious medical issues.