It became known as "mission impossible". The operation to save 12 young football players and their coach trapped in a cave in northern Thailand captured the attention of the world. Could a team of rescuers pull off a heroic feat and bring all the "Wild Boars" to safety?
Lasting three days, the mission was a feat of physical endurance and international co-operation, but it was also shrouded in secrecy.
An announcement over a loudspeaker on Sunday, July 8, for non-rescue personnel to clear the cave complex sent international media into a flurry of excitement and panic. Was a rescue mission afoot or had something ominous happened?
It became apparent that impending monsoon rains were threatening to submerge the small island the boys were perched on, while dropping oxygen levels had precipitated a rescue operation in which the boys would have to swim out one by one, guided by elite rescue divers.
The Wild Boars football team became trapped on June 23 while they were exploring the Tham Luang caves with their coach after a practice session. Heavy monsoons fell causing flooding at the entrance. Some of the boys could not swim so they retreated further into the cave. Eventually they were pushed four kilometres deep inside the limestone cave complex.
The alert was eventually raised after the boys failed to return home and their bikes were found at the cave entrance.
Hundreds of rescue workers scoured the mountains for alternative entrances to the passage in which the boys were assumed to be stuck.
After nine days stranded in darkness, the boys finally saw a light at the end of the tunnel – a torch belonging to one of two divers from the British Cave Rescue Council.
"How many of you?" a diver asked. "Thirteen? Brilliant." The boys had been found.
The prospect of extracting the boys through the same submerged tunnel was initially considered too risky to consider under any circumstances except a last resort.
Scenes of jubilation after final boys rescued from Thai cave
Thai cave rescue: all players and coach rescued on third day - live updates
Global support for Thai boys is inspiring
To attempt the dive through murky flood waters, in the dark, with delicate and clumsy breathing apparatus would test the skill of experienced divers, let alone with children, some of whom could not swim.
Indeed, one of the rescuers, former Thai Navy Seal Saman Kunan, died in the cave when he ran out of oxygen.
As other rescue options were ruled out, Thai authorities said teaching the boys to dive could take months.
But as monsoon rains continued to raise water levels in the cave, the plan was speeded up. Each boy was to be accompanied by two divers, and guided by a rope attached to the walls. The diver at the front would carry oxygen for the boy. Those identified as the strongest were selected to attempt the arduous escape first.
Operations officials identified the dark, narrow and twisting Sam Yak junction as a potential "crisis" point for the boys. After that point the tunnel widens, waters subside, and walking is possible.
Against all odds, four of the boys were rescued from the cave on the first day by an international team of 90 rescue workers, which included 50 international personnel. After reaching the surface the boys were assessed at a field hospital at the mouth of the cave, and then transferred to Chiang Rai hospital by ambulance and helicopter.
Overnight, waypoint caverns in the cave were restocked with oxygen canisters, and on the morning of July 9, the second day of the extraction mission began. After five-and-a-half hours, the first boy emerged, two hours faster than on the first day. After that, news of subsequent three rescues fell into a rhythm.
The atmosphere turned from tension to optimism. In the media centre, journalists were served khao pad kraprow, a comforting basil chicken dish the boys had requested on their rescue from the caves.
Thailand's prime minister Prayut Chan-o-cha visited the caves in the evening, shaking hands with Thai Navy Seals and thanking the international volunteers, before travelling to the hospital in Chiang Rai.
Narongsak Osottanakorn, the mission chief told international media he was pleased with the day's operation, but tempered expectations for the next day's rescue, saying "the best number [to rescue] is four". There were four boys and their coach still left in the caves, plus medical staff.
News of the operation had captured the hearts and minds of people around the world. Affectionate cartoons of cute boars being led from the cave by seals and frogs were shared widely on social media. The Thai Navy Seals posted celebratory messages on their Facebook page, ending each with "hooyah". The special forces' cry echoed internationally.
For a brief moment during the World Cup, 12 Thai footballers aged between 11 and 16 were the most talked-about players in the world.
On the third day of the operation, rescue teams wasted no time starting the final leg of the operation. In a press conference Narongsak announced the teams would attempt to rescue the remaining boys and their coach.
"We expect that if there is no unusual condition ... the four boys, one coach, the doctor and three Seals who have been with the boys since the first day, will come out today," he said.
The press centre burst into applause, volunteers set up a charcoal grill and a coconut soft serve stand arrived.
News of the boys' condition in Chiang Rai hospital also reached the camp. They were all in "good health", although two boys were being treated for a lung infection, and all the boys had lost weight. A quarantine was set up in the hospital to reduce the risk of infection. Families were unable to be reunited with their children, although parents of the first four boys rescued could see them through a glass window.
Shortly after 1pm UAE time, the news came of the first boy of the day to be extracted from the cave. The remaining boys were saved in quick succession, and shortly afterwards their coach. Applause and cheers erupted as helicopters carrying the Wild Boars flew overhead.
"We are not sure if this is a miracle, a science, or what. All the 13 Wild Boars are now out of the cave," the Thai Navy Seals wrote.
Mission impossible it was not, chief rescuer Narongsak said. "Nobody thought we could do it. It was a world-first," he said. "It was mission possible for Team Thailand."