When they failed to return from their hike, Thai officials launched a massive search and rescue operation involving more than 1,000 people, including search and rescue specialists drawn from all over the world. Persistent rain complicated efforts to locate the group.
When they turned their attention to the Tham Luang Nang Non cave -- the longest one in Thailand -- rescuers had to navigate dark, narrow passageways filled with muddy water and rough currents, amidst the uncertainty of oxygen-depleted air.
Then, on July 2, two British divers found all 13 alive in an area about three miles from the cave’s main entrance -- offering unexpected hope to the anguished families and friends of the missing 13.
Food, electrolyte drinks, drinking water, medicine and oxygen canisters have been delivered to the team. Rescuers have closely monitored oxygen levels in the boys' safe space, fearing it could fall dangerously low.
By Saturday, three Thai navy SEALs, one a doctor, were giving the boys and their coach health evaluations and rehabilitation, and teaching the members of a soccer team known as the "Wild Boars" diving skills.
About two weeks into the ordeal, Thai Navy SEALS who made contact with the stranded crew of soccer players and their coach began ferrying touching, handwritten letters from the young boys to their families and friends.
Chanin "Tun" Wiboonrungrueng, 11, urged his parents not to worry about him.
"Dad, Mum, don't worry I'm fine," he wrote in a letter to his family, cheerfully preparing them for his eventual return. "Tell Yord, prepare to bring me fried chicken to eat."
In a moving note of reassurance and apology, Ekapol Chanthawong, 25, the boys' coach, wrote: "To the parents of all the kids, right now the kids are all fine, the crew are taking good care. I promise I will care for the kids as best as possible. I want to say thanks for all the support and I want to apologize to the parents."
They received invitations from officials of the World Cup, and a heartfelt message from one of the Chilean miners, one of 33 miners trapped in a mine for 33 days in 2010.
Then, with hope waning but not extinguished, Chiang Rai acting Gov. Narongsak Osatanakorn announced over the weekend that the time had come to launch the rescue operation.
He said 13 foreign and five Thai divers would take part in the rescue, and reassuring worried family members that each boy would be accompanied by two divers as they are extracted from the frightening subterranean conditions.
With fresh monsoon rains threatening from above and oxygen levels plunging below inside the cave, rescuers had a brief window of time to act.
"We have a fraction of a second to help them come out," Osatanakorn said as the bold rescue operation got underway.
Officials said rescuers conducted drills all day Saturday on how they would transport the children to the hospital once brought out of the cave.
The rescue effort got underway at 10 a.m. local time on Sunday, with an hours-long descent through muddy, slippery crevices and cavernous water pools -- as ambulances and helicopters stood by on dry land to whisk weary soccer players and their coach to hospitals if they could be extracted alive.
In a succession of miraculous moments for the scores of rescuers, families and local officials that spanned several hours, expert dive teams climbed from the mouth of the cave with four of the teenage boys.
The first boy emerged from the cave at 5:40 p.m. local time, according to Osatanakorn. Ten to 20 minutes later, a second boy emerged with rescuers. Roughly two hours later, a third and then a fourth boy reached daylight.
The operation continues in a few hours, when pairs of divers working in "buddy teams" will try to save the eight remaining boys trapped underground with their coach.
If rescuers follow the plan they executed Sunday, the boys' odyssey will move them in increments -- sometimes trudging through mud, sometimes floating through watery caverns, and carefully navigate the dark, treacherous trek upwards, taking rests where necessary.
The divers who risked their lives to help the children were determined before going into the cave.
The group shared a photo on Facebook over the weekend showing interlocking arms above the message, "We, the Thai team and the international team, will bring the Wild Boars home."