Twelve boys and their football coach who were trapped in a cave in northern Thailand for more than a fortnight have been rescued in an unprecedented three-day mission that had all the features of a blockbuster film.
The complex effort to get the "Wild Boars" out of the Tham Luang cave ended on Tuesday in success after meticulous planning, cooperation and no small amount of luck.
Here is how what the rescue chief called "Mission Impossible" unfolded over 72 hours as Thailand and much of the world anxiously awaited news of the boys' fate.
The boys, aged 11 to 16, had no diving or scuba experience but quickly had to learn what they could. Foreign and Thai Navy SEAL divers practised with them near the muddy embankment where the young footballers were found nine nights after walking into Tham Luang on June 23.
"They are getting forced to do something that no kid has ever done before. It is not in any way normal for kids to go cave diving at age 11," Ivan Karadzic, who runs a diving business in Thailand, told the BBC on Tuesday.
The danger was highlighted by the death of a former Navy SEAL as he helped bring oxygen tanks along the route.
Volunteers celebrate near Tham Luang cave complex in the northern province of Chiang Rai. (Photo: Reuters/ Zeya Tun)
One by One
Led by 13 "world class" divers, the boys were accompanied by two adults each, with others stationed in junctions along the way.
They wore face masks and were tied to buddy divers who carried their oxygen tanks, guiding them through more than two kilometres of narrow, dark corridors using torches and guide ropes.
They came out one by one, with four emerging on Sunday, four on Monday, and the remaining four and the coach extracted Tuesday.
Each round trip took around 10 hours on average, but the final day of mission was fastest, with the last five confirmed out in about nine hours.
Experts had worried that the harrowing journey could make the boys panic, triggering an underwater accident. Those concerns led rescuers to approve a mild sedative that calmed the youngsters, according to Thailand's junta chief Prayut Chan-O-Cha.
Prayut said that a "minor tranquilizer" had been used to help keep the kids calm on the terrifying swim to freedom, much of it in water with very low or no visibility.
The first eight boys to exit the cave have been recovering in quarantine in Chiang Rai hospital. All have been given jabs for rabies and tetanus, and two have received antibiotics after presenting pneumonia-like symptoms.
But doctors have played down fears of immediate physical and mental damage saying the boys were "in good spirits" while some asked for chocolate.
There was no immediate update on the health of the remaining five who emerged from the cave on Tuesday, but Thai Navy SEALS said they were "safe". Experts have warned of the risk of long-term trauma from their ordeal.