Rescuers have freed the last four of 12 Thai boys and their soccer coach from deep inside a flooded cave, bringing a successful end to the perilous mission that gripped the world for more than two weeks.
The Wild Boars soccer team, aged between 11 and 16, and their 25-year-old coach became trapped on June 23 while exploring the cave complex in the northern province of Chiang Rai when a downpour flooded the tunnels.
"We are not sure if this is a miracle, a science, or what. All the thirteen Wild Boars are now out of the cave," the Navy SEAL unit, which led the rescue, said on its Facebook page, adding all were safe.
British divers found the 13, hungry and huddled in darkness on a muddy bank in a partly flooded chamber several kilometres inside the Tham Luang cave complex, on Monday last week.
After pondering for days how to get the 13 out, a rescue operation was launched on Sunday when four of the boys were brought out, tethered to rescue divers.
Another four were rescued on Monday and the last four boys and the coach were brought out on Tuesday, prompting rounds of spontaneous applause as ambulances and helicopters passed.
Celebrations were tinged with sadness over the loss of a former Thai navy diver who died on Friday while on a re-supply mission inside the cave.
Chief of the rescue mission Narongsak Osottanakorn addressed reporters at the end of the 17-day mission, arriving at a media centre to a round of applause.
He confirmed that a medic and all navy SEAL divers involved in the rescue mission had also left the cave safely.
"Nobody thought we could do it. It was a world first," he said, paying tribute to the multinational team that assisted in the operation. "It was Mission Possible for Team Thailand.
"The heroes this time are people all over the world," he added, referring to the multinational team that assisted in the operation.
"This mission was successful because we had power. The power of love. Everybody sent it to the 13."
Officials said details of the rescue operation would be revealed on Wednesday.
The eight boys brought out on Sunday and Monday were in good health overall and some asked for chocolate bread for breakfast, officials said earlier.
Two of the boys had suspected lung infections but the four boys from the first group rescued were all walking around in hospital.
Volunteers from as far away as Australia and the United States helped with the effort to rescue the boys. US military personnel also helped.
The boys were still being quarantined from their parents because of the risk of infection and would likely be kept in hospital for a week for tests, officials said earlier.