All 12 boys and their soccer coach trapped for more than two weeks deep inside a flooded Thai cave have been rescued, a Thai navy SEAL unit said on Tuesday, a successful end to a perilous mission that gripped the world.
"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 SEAL unit said on its Facebook page, adding all were safe.
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 after soccer practice and a rainy season downpour flooded the tunnels.
British divers found the 13, hungry and huddled in darkness on a muddy bank in a partly flooded chamber several kilometres inside the 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.
Celebrations will be 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.
The last five were brought out of the cave on stretchers, one by one over the course of Tuesday, and taken by helicopter to hospital.
Three members of the SEAL unit and an army doctor, who has stayed with the boys since they were found, were the last people due to come out of the cave, the unit said.
Officials did not comment on the rescue mission as it took place, so details of the final day of the rescue and the condition of the last five to be brought out were not immediately known.
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.
"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 said on Twitter.
"Such a beautiful moment - all freed, great job!"
Authorities did not reveal the identity of the boys as they were brought out, one by one. Parents of the four boys rescued on Sunday were allowed to see them through a glass window at the hospital, public health officials said on Tuesday, but they will be quarantined for the time being.
Officials said the rescued boys had not been identified out of respect for the families whose sons were still trapped.
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.