The final five members of a young football team were rescued from a flooded Thai cave on Tuesday after spending 18 harrowing days trapped deep inside, completing an astonishing against-the-odds rescue mission that captivated the world.
Elite foreign divers and Thai Navy SEALs extracted the final batch of four boys, plus the 25-year-old coach, on Tuesday afternoon via a treacherous escape route that required them to squeeze in darkness through narrow, water-filled tunnels.
"All 12 'Wild Boars' and coach have been extracted from the cave," the SEALs said in a Facebook post, referring to the boys by the name of their football team.
"All are safe," they added, then signed off with what has become their trademark "Hooyah" that they used to celebrate the successful extractions of the other eight boys over the previous two days.
The children, aged from 11 to 16, and their coach, ventured into the Tham Luang cave in mountainous northern Thailand on June 23 after football practice and got trapped when heavy rains caused flooding that forced them to take shelter on a muddy ledge.
They spent nine days in darkness until two British divers found them, looking gaunt but offering smiles to the divers and appearing to be in remarkably good spirits.
The initial euphoria at finding them dissipated as authorities struggled to devise a safe plan to get them out, with the shelf more than four kilometres (2.5 miles) inside the cave and the labyrinth of tunnels leading to them filled with water.
Authorities mulled ideas such as drilling holes into the mountain or waiting months until monsoon rains ended and they could walk out, with the rescue chief at one point dubbing the efforts to save them "Mission Impossible."
With oxygen levels in their chamber falling to dangerous levels and monsoon rains threatening to flood the cave above the ledge where the boys were sheltering, rescuers decided on the least-worst option of having divers escort them out through the tunnels.
Thai Prime Minister Prayut Chan-O-Cha revealed on Tuesday the boys had been given some medication to help them remain calm.
"It was a minor tranquiliser to prevent [the] boys from being anxious," Prayut told reporters.
The ups and downs of the rescue bid entranced Thailand and also fixated a global audience, drawing support from celebrities as varied as US President Donald Trump, football star Lionel Messi and tech guru Elon Musk.
"On behalf of the United States, congratulations to the Thai Navy SEALs and all on the successful rescue of the 12 boys and their coach from the treacherous cave in Thailand," Trump tweeted. "Such a beautiful moment - all freed, great job!"
Manchester United also invited the "Wild Boars", as well as those involved in the rescue, to travel to England and visit the club.
"Our thoughts and prayers are with those affected. We would love to welcome the team from Wild Boars Football Club and their rescuers to Old Trafford this coming season," the club said in tweet.