Nine days.

That's how long 12 boys and their soccer coach were missing, believed to be trapped in a flooded cave in northern Thailand, presumably stuck without food or drinking water or much by way of survival gear, and almost certainly scared for their lives.

But rescue teams refused to give up. And on Monday, after nine long and arduous days, the boys and their coach were found alive in the cave — a godsend for their anxious families and joyous news for a country that had been riveted to televisions and social media, desperate for updates.

The discovery was the culmination of an evidently painstaking operation involving Thai navy SEAL divers, a U.S. military team, British cave experts, Chinese first responders, and volunteer workers from countries around the world.

It was, by all accounts, a challenging mission laden with setbacks. The divers, for example, were thwarted again and again by rising floodwater that forced them to pull out of the extremely narrow passageway to the cave. Here's an overview:

June 23

The boys, aged 11 to 16, and their 25-year-old coach disappear after a soccer game. They are thought to be caught in the partially flooded Tham Luang Nan Non cave in Chiang Rai, a popular tourist attraction in the region.

Families report the boys missing when they do not come back from team practice.

June 24

A rescue operation begins, and some workers begin to bring in pumps to be used to decrease the water level.

June 25

The deputy governor of the Chiang Rai Province, Passakorn Bunyalak, tells reporters that he is confident the soccer team is alive. "The kids are athletes, and they have skills," he says. "They are alert all the time, and they are always active. They will try to survive by continuing to move."

Thai soldiers carry equipment inside the flooded cave complex. Royal Thai Army / via EPA

June 27

Heavy rainfall hampers rescue efforts. The underground passages are flooded faster than the water, rising in some places at a rate of nearly 6 inches per hour, can be pumped out.

The relevant agencies work furiously, scouring the site in 24-hour rotations.

June 28

A U.S. military team and British cave experts join the Thai navy to help with the frantic search. The divers continue to face strenuous conditions. They must fit their bodies around L-shaped bends in the passageway, for example.

Meanwhile, crews search for shafts from the surface of the mountain that might present another way of getting into the blocked parts of the cave.

June 29

Another setback: At least three rescuers near the entrance to the cave appear to suffer electric shocks. The likely cause: Jerry-rigged electrical lines snaking through the caverns to power lights and pumps.

Officials prepare oxygen tanks during the rescue operation. Royal Thai Army / EPA

July 1

The water levels fall, and the navy SEAL divers pass through a chamber where murky floodwaters had previously cut off their efforts. They use a methodical technique, moving along with a rope line and extra oxygen tanks, and manage to enlarge the passageway.

July 2

The boys and their coach are found alive, clustered on the floor of the cave in their uniforms. The governor says crews will send doctors and food to help. But more water will need to be pumped out of the caves before the soccer team can be rescued.

"We found them safe. But the operation isn't over," the governor says.

July 3

Thailand's navy SEALS detailed eight steps they will be taking in order to return each member of the soccer team to safety, the National News Bureau of Thailand reported.

At the top of the list is an assessment of each of the boy's health conditions and ability to make the journey out of the cave system to where a field hospital will be set up. Anyone in critical condition will receive immediate treatment at the makeshift hospital near the cave's entrance, while those who can be moved will be flown by helicopter to Chiang Rai Hospital, where doctors briefed on the boys' conditions will be ready to provide treatment.

The entire rescue for each person was predicted to take about 30 minutes.