After a football practice on Saturday 23 June, 12 young players and their "Wild Boars" team coach entered the 10km (6 mile) Tham Luang cave complex in Chiang Rai province, northern Thailand.
When they failed to return home, a huge search operation was launched, with rescuers facing a race against time to find them as heavy rain battered the region and flooded parts of the cave.
After 10 days, they were found weak but alive and planning for their rescue began. Here is how the events unfolded.
25 June Search and rescue operation begins
Police say they are working with local authorities and divers in the search for 12 boys aged 11 to 16, as well as their coach.
They are believed to have entered the Tham Luang Nang Non cave in Chiang Rai province.
The young team, known as the Wild Boars, became trapped when a heavy rainstorm flooded a stream at the cave's entrance.
Bicycles and football boots belonging to the boys are found near the entrance of the cave.
The search begins at about midnight after police receive a report of a missing child from a mother who says her son has not returned from football practice.
26 June Cave drained for divers to join search
Specialists pump out water to allow navy divers to operate in the cave complex.
Thailand's interior minister Anupong Paojinda says divers can proceed only when enough water has been pumped out, to give breathing space between the water and the ceiling.
He says rescuers are working night and day.
"I want to confirm to the media that the SEAL team will be working non-stop because it's already dark here too," he says.
27 June Heavy rain hampers search efforts
Persistent heavy rain deters hopes to reach the boys and their coach as military teams struggle through water inside the cave.
Commander Buncha Duriyapan says: "Last night we worked non-stop in order to drain water out of the cave as much as possible."
General Chalermchai Sittisart of the Thai army says hope has not been lost.
"We still have hope. All agencies are trying their best. We have a challenge from the water level which keeps rising."
28 June British divers join rescue
Three cave diving experts from Britain fly to Chiang Rai province to help the search, five days after their disappearance.
Richard William Stanton, Robert Charles Harper and John Volanthen enter the cave in full kit before emerging an hour later.
Some of the rescue divers are forced to turn back after floodwater seeps into a second chamber of the caves, with heavy rain continuing to hamper the search.
30 June Thai police drop food packages for missing team
After six days missing, packages are dropped through a shaft in the mountainside in the hope of reaching the boys and their coach.
Twenty packages filled with water, food, medicine, torches and a note addressed to the missing team are dropped down a fissure in the cave.
Colonel Kraiboon Sotsong says: "If the children find this box we want them to float the box out of the cave.
"The note says: 'If received, then reply and show on the map where you are. Everybody will quickly help."
1 July Rescuers believe missing team has a chance of survival
Divers continue searching the murky waters as heavy rain causes flooding, preventing them getting through chambers to get deeper into the cave.
After the rain eases, divers from the Thai Navy SEAL unit are able to make progress through the water filled passages of the underground maze.
Chiang Rai governor Narongsak Osottanakorn says: "The situation is better today than yesterday and the day before."
Rescuers say they believe the boys have a chance of survival, with possible access to fresh water inside the cave - either dripping though rocks or rushing in through the entrance.
2 July Boys found alive after 10 days
There are jubilant scenes as rescuers confirm they have found the boys and their coach alive, but "very weak".
Governor Narongsak says they are safe but the rescue operation is not over, as they now need to get them out.
"Now the difficulty is getting them out because they are underground within this massive cave complex," says Sky News' Lisa Holland, who is at the scene.
"Things have been complicated because the underground complex is completely flooded due to heavy monsoon rain."
The moment the boys were reached by a British rescuer was captured on video.
He can be heard reassuring the youngsters that "many people are coming".
Torchlight shows the frail-looking boys sitting on a muddy bank inside the cave, with water between them and the rescue party.
The British rescuer, who has not yet been named, is thought to be either Richard William Stanton or John Volanthen.
3 July Boys must learn to dive, military says
The Thai military says the boys could be given enough food to last four months while they are taught to dive.
According to a statement from Thailand's Armed Forces, navy Captain Anand Surawan said: "(We will) prepare to send additional food to be sustained for at least four months and train all 13 to dive while continuing to drain the water."
Caving experts warn that having the boys attempt to dive out themselves could be extremely dangerous, with "significant technical challenges".
4 July Plans coming together for rescue
The boys and their coach are having their fitness evaluated daily and will be rescued in stages depending on their health, a Thai official says.
"All 13 may not come out at the same time. If the condition is right and if that person is ready 100%, he can come out," says Narongsak Osatanakorn, the Chiang Rai provincial governor.
5 July Water is pumped out of the cave to prepare for rescue
The rescue preparation begins with water being pumped out of the flooded cave, rescuers running against the clock to beat monsoon rains.
Water levels are reduced by around 40% but some parts of the passageway needed to rescue the boys are still completely impassable. This leaves diving out as the only survival option.
6 July Thai diver dies trying to save the group
A former Navy SEAL diver Saman Gunan dies while taking part in the mission to rescue the boys, who are trapped 2.5 miles within the cave network.
Mr Gunan had been working as a volunteer during an overnight mission in which he had been delivering oxygen canisters in the Tham Luang cave system, according to authorities.
He died on the way back to safety but fellow divers say they remain determined to complete the rescue.
7 July Boys write letters home
The boys write notes to their parents about what is happening. They talk about the family members they love. Some apologise, others say not to worry.
They also look to the future, one reminding his parents about his upcoming birthday party and another saying he wants to go for fried chicken when he gets home.
8 July Operation to bring boys out begins
Authorities say the operation to bring the 12 boys and their coach out of the cave has begun in the early morning and that by 3pm BST they expect the first to emerge.
But by mid-afternoon UK time the first four are out of the cave and receiving medical treatment.
Should you block ads? Adblocker