The youngsters, aged between 11 and 16, and their 25-year-old coach went into the Tham Luang cave in northern Thailand after football practice.
They were reported missing by a mother after her young son did not come home that night.
Local officials start to look for the boys after they are believed to have become trapped by heavy rains which cut them off from the main entrance.
They find bicycles locked to a fence and shoes and football boots belonging to the kids close to the entrance.
Park officials and police kick into gear to find the boys and heavy rains continue to fall in the area near the Laos and Myanmar borders.
They find handprints and footprints believed to belong to the boys and think they likely retreated into the winding tunnels as they became hemmed in by rising floodwaters.
Relatives keep a vigil outside the cave where they will stay for nine days straight desperately awaiting news.
Thai Navy SEAL divers are in the cave searching for the boys, armed with oxygen tanks and carrying food.
Makeshift shrines are set up for parents to pray and make offerings.
Heavy rains continue, sparking fears that floodwaters within the cave could rise.
The boys are believed to have retreated further into the cave to an elevated air pocket called "Pattaya Beach".
Divers reach a T-junction several kilometres inside the cave but are forced back by rushing floodwaters that clog a narrow crevice near Pattaya Beach.
Rescue operations run around the clock but it is a race against time as rains continue to fall.
Thailand's junta leader Prayut Chan-O-Cha calls for the nation to support the rescue.
A team of more than 30 American military personnel from the US Pacific Command, including pararescue and survival specialists, arrive at the site late Wednesday.
They are joined by three British diving experts who go into the cave's entrance but quickly retreat because of heavy flooding.
Continuing rains are causing flood levels to rise, and officials say conditions are "difficult".
The underwater rescue is temporarily halted because of the fast-moving floods inside the cave as downpours refuse to let up.
Water pumps are shipped in to drain the rising floodwaters that are so murky it is likened to swimming through cold coffee.
American experts get to work around the base, while the three British divers and others scour the mountain for alternative entrances into the cave.
Drones are dispatched to help find new chimneys.
A glimmer of hope as rescue teams find a possible opening, but there is no guarantee it will connect to the main cave network.
Prayut Chan-O-Cha visits the site and leads a meditation, jokes and cooks with relatives, asking them not to give up hope.
A break in the bad weather allows divers to reach further inside the cave but they are still several kilometres away from where the boys are believed to be.
Teams continue to search for alternative openings above ground and rescuers conduct practice drills to safely evacuate the boys if and when they are found.
Divers inch further into the cave taking advantage of the brief break in bad weather.
Rescuers set up an operating base inside the cave and hundreds of oxygen tanks and other supplies are pulleyed in. Divers can now stay remain underground for longer.
As the the sun breaks out, Chiang Rai governor Narongsak Osottanakorne says conditions for the operation are improving.
A miracle, finally: the 12 boys and their coach are found alive and safe about 400 metres further along from Pattaya Beach - which had become threatened by encroaching flood waters.
Crowds at the teeming rescue site cheer the good news and a nation breathes a sigh of relief.
But attention now turns to the difficult task of now getting the boys out safely.
The main priority is to get them food and first aid after nine days with little to eat in difficult conditions.
It could take days - or weeks - to get them out. Rescuers explore several options, including training them to use scuba equipment.
Much-needed food and medical supplies - including high-calorie gels and pain killers - reach the boys as rescuers prepare for the possibility that they may remain in the cave for some time.
Officials say the group are being taught how to use diving masks and breathing apparatuses.
Teams pump out water around the clock as more rain is forecast for the days ahead.
In a sign of increased urgency, authorities say expected rains may force a complex rescue quicker than first thought.
A team of bird's nest collectors scour the mountainside in search of new openings into the cave roof.
Tragedy strikes: a diver helping to establish an air line to the boys dies after passing out while returning from the chamber.
Saman Kunan's death raises serious doubts over the safety of attempting a rescue through the cave's waterlogged passageways.
Thailand's Navy SEAL commander says oxygen levels inside have dropped. He warns the window of opportunity to free the youngsters is "limited".
Rescue operations chief Narongsak Osottanakorn says the boys are not ready to dive to safety.
A scrawled message emerges from the team's coach, offering his "apologies" to their parents, while in other touching notes the boys tell their relatives not to worry.
Divers lead four of the boys out of the cave as night falls, sending them to the hospital. Narongsak says they are "safe" but no other details are given about their conditions.
He says late in the evening that the rescue mission will not start again for at least another ten hours to give time for oxygen and other supplies to be replenished.
Authorities keep the public guessing over the identities of those rescued so far. As dusk falls four more of the team have been rescued - leaving four more boys and their soccer coach inside the cave.
Thai Navy SEALs confirm that all 12 boys and their coach were successfully brought out of the cave, bringing to an end an extraordinary rescue operation that involved teams of divers from around the world.