The dramatic mission to save 12 boys and their football coach from a flooded cave in Thailand captivated global attention and sparked an outpouring of joy when the young team emerged safe and sound.
The Wild Boars squad, aged 11 to 16, had entered the Tham Luang cave on June 23 with their 25-year-old coach, but a sudden downpour flooded the complex and trapped them inside.
Nine days later British divers found the group, dishevelled and hungry, on a ledge four kilometres (2.5 miles) from the entrance and surrounded by murky water.
A worldwide audience followed every twist and turn of the week-long operation by cave divers, survival specialists and medics as they raced against rising waters to get the boys out.
The death of a retired Thai Navy SEAL underlined the difficulty of the operation.
But sorrow turned to joy as the team were brought out in groups of four or five, and by Tuesday night they were recovering in hospital.
Here are some other amazing rescues that also ended happily despite enormous obstacles.
French cave, 1999
On November 22, 1999, rescuers reached seven men who had been trapped in a cave system in southwest France for 10 days.
The men, all experienced cavers, became trapped in the caves at Vitarelles when heavy storms caused flooding, cutting them off from the exits.
The unprecedented rescue mission riveted France, with experts drilling multiple shafts into the rock in a bid to find the men.
They eventually reached them after squeezing into one of the shafts and following an underground river.
The men had carefully rationed their food and still had enough water and lighting gas for two days when they were rescued. All were in good health.
Russian submarine, 2005
The seven-man crew of a Russian Priz mini-submarine were running out of air after three days trapped under water when they were finally rescued.
Their submarine became entangled in marine debris on August 4, 2005, and the Russian crew was powerless to move from the position around 190 metres (625 feet) below the ocean surface.
The incident immediately drew comparisons with Russia's Kursk submarine accident five years earlier, which ended in tragedy with the deaths of all 118 crew.
But the Priz crew were rescued after a British undersea robot cut the vessel free.
Russian President Vladimir Putin awarded medals to the British team who rescued the submarine crew and Moscow announced it would purchase several of the type of underwater robots used in the rescue.
Chilean miners, 2010
The plight of 33 men trapped in a Chilean mine 600 metres (2,000 feet) underground after a rock collapse on August 5, 2010 captured international headlines.
The men had been virtually given up for dead when a probe sent down through a narrow borehole struck lucky, 17 days later.
The men had been surviving on dwindling rations, with just 15 cans of tuna between them, said survivor Franklin Lobos.
"We ate a teaspoon of it every 24 hours, then every 48 hours and finally we were eating a teaspoon every 72 hours. It was horrible."
Even after the men were located and supplies were sent to them, it took weeks before rescuers were finally able to bring the miners to the surface.
In all, their ordeal lasted nearly 70 days.
Miners in Peru, 2012
Nine miners, including a father and son, spent seven days trapped underground after a cave-in in southern Peru on April 7, 2012.
Rescuers led the men out wrapped in blankets and wearing dark glasses to protect their eyes after so many days without sunlight.
The rescue operation at the illegal mine was hampered by fears of additional collapses as rescuers dug through rock and soil.
Huddled in an opening 250 metres (800 feet) underground, the men joked and exercised to pass the time and stay positive.
"This moment, it's like being reborn," said one of the rescued men after a tearful reunion with his family.
German cave, 2014
More than 700 emergency personnel worked to rescue Johann Westhauser after he sustained a serious head injury deep inside a German cave system on June 8, 2014.
The 52-year-old was with two other people when a rockfall caused the head injury. One made the hours-long walk back to the surface to raise the alarm, while the other stayed with Westhauser.
His injury made it impossible for him to move, and rescue workers and medical professionals from five countries worked to medically evacuate him from a spot 1,000 metres (3,300 feet) below ground.
His rescuers battled dangerous conditions and near-freezing temperatures as they methodically negotiated a treacherous network of tunnels and chambers, underground lakes and ice-cold waterfalls.
He was eventually hauled out of the cave system on a stretcher 11 days after being injured, in an operation local officials said had seemed "simply impossible."