Seven members of a Thai navy Seals unit, including a medic and a counsellor, were staying with the group after its dramatic discovery on an elevated rock late on Monday by divers who had struggled for hours through narrow passages and murky waters.
News of the survival of the "Wild Boar" team sparked jubilation in a nation gripped by the harrowing drama, with news websites, social media and the prime minister celebrating the event and hailing the rescuers as heroes.
"Thank you all Thais, thank you all foreigners, everybody is a hero and everybody helped each other," Prime Minister Prayuth Chan-ocha told reporters.
A video shot by the rescuers in flickering torchlight 4km from the mouth of the cave in Thailand's northernmost province showed boys clad in shorts and red and blue shirts sitting or standing on the rock above an expanse of water.
"How many of you are there - 13? Brilliant," a member of the multinational team tells the boys in English. "You have been here 10 days. You are very strong."
"Thank you," responded one of the boys.
Aged between 11 and 16, the boys and their 25-year-old coach went missing on June 23, after they set out to explore the caves in a forest park following a training session.
Rear Admiral Apakorn Yuukongkaew, commander of the Seals unit, said rain was still a challenge but the boys would be taken out safely as soon as sufficient water could be pumped out of the cave.
"But if that doesn't work, with the seasonal rain, we'll do it another way," he told reporters.
"We have Plan 'A' and Plan 'B', and ultimately, everyone will return to their parents' embrace."
The 13 have been given a gel with high calorie and mineral content to sustain them while rescue plans are worked out.
Officials declined to say what plans 'A' and 'B' were, but said they aimed to bring the boys out the same way they had entered.
HIGH-PROFILE RESCUE
Options included teaching the group to use smaller diving apparatus and guiding them out of the caves, from which 120 million litres of water had been pumped continuously for 75 hours by Tuesday evening.
The Seals tried to get phone lines into the cave to allow the boys to speak to parents and families staying at a nearby shelter throughout what could be Thailand's most high-profile rescue mission.
At the Tham Luang cave complex in Chiang Rai, security personnel turned away scores of people who came to show support, while more journalists joined hundreds of media representatives who have covered the drama blow-by-blow.
Two British divers experienced in cave rescues, John Volanthen and Rick Stanton, were first to reach the boys, accompanied by the Seals divers.
Their search targeted an elevated mound they believed could have provided a refuge, but that was already flooded, so they went 400m further, and found the team.
News of the discovery sparked jubilation among relatives and rescuers and spread swiftly enough to figure on the front pages of Tuesday's newspapers.
"Found the 13 'Wild Boars', safe and preparing to come out," was the headline in the country's biggest daily, Thai Rath.
Caricatures of smiling volunteers, rescue workers and media spread on social media and messaging platforms, applauding a search mission that involved citizens of Australia, Britain, China, Japan, Myanmar and the United States, among others.
"Take our hearts - thank you," read one cartoon, while another read "You are our heroes," followed by "Thank you," in eight languages.
Thais posted messages of joy and relief on Facebook, showering praise on Chiang Rai governor Narongsak Osottanakorn. "Have to applaud this man," said one, while another asked, "Why not try for prime minister?"
His deputy, Passakorn Bunyalak, dismissed rumours that the mission could last up to four months, but said the boys' safety was paramount and their extraction should not be rushed.
Sura Jeetwatee, a doctor involved in the operations, said the team survived by staying put and drinking water that dripped from stalactite formations.
Seals commander Apakorn said the flow of a cave stream had slowed and water once at head level was now at shin level. He said the boys were in relatively good condition.
"The children have been in there for ten days, they have food, doctors – they are doing well," he said. "There is no rush."