Transcript for 'The Boys in the Cave': How 12 boys, coach escaped a cave in Thailand

Once I started doing the reporting, it quickly materialized that these kids were completely sedated. They were out, Dan. I mean, these boys were so sedated, you could easily have operated on them and they would have felt nothing. I mean, they were essentially vegetables being hauled through that tunnel and the decision was if we don't do this, they will panic and almost certainly die. Not only them, but they would take the divers down with them. When people panic when they dive, they grab at the divers, their rescuers, rip face masks, tear their regulators out of their mouth. They'll do anything to try to survive even though what they're actually doing is killing themselves and the diver. Reporter: It's the heart-stopping untold story of the rescue that captivated the world. In the urgent ask you operation in Thailand, 12 young soccer players and their coach. Found alive in a flooded cave in Thailand. More than two weeks in a cave without any real food, very little water. Authorities say that high risk operation is now under way. Tonight, all 12 young soccer players and their coach are free. That is the great news. Reporter: Outside that cave in Thailand, a picture of patience and perseverance. Inside, 12 boys and their soccer coach. How many of you? 13? Brilliant. Reporter: Trapped miles deep by flood waters, struggling to survive as they waited to be rescued. The boys used to practice on this soccer field. My colleague, ABC's Matt Gutman right there for it all, now revealing startling new details about the massive international ask you effort in his new book "The boys in the cave" the mistakes that nearly doomed the mission and a controversial decision that rendered the boys unconscious. The decision to sedate, was that controversial? It's so controversial, and one of the only places that you'll see it is in the book, that the Thai government has basically clamped down on it, censored information and there was a very awkward moment in Thailand where I met the parents and I started talking about the sedation, and they said, what? What do you mean, sedation? I was the first person to tell them nearly six weeks after the rescue that their children had been sedated. They had no idea. Reporter: Shedding new light on the urgency facing Thai officials and a stunning admission. Soon after the reporting started, I understood that the divers themselves expected most of the boys to die on the way out, and they told the Thai government this. They basically said to the Thai government, they will asphyxiate in this tiny chamber that they're in, they might die of disease, two of them have pneumonia. This is going to get really ugly really fast. We have to do something now. I never had to think for a second about whether I would go. I think it's human nature to know if you've got an ability and of course you will. We always knew we could get them out. It was whether we could get them out alive or not. Reporter: In the book, Matt uncovers many of the harsh realities. Behind difficult decisions the divers were forced to make. They really thought going in there that 75% to 80% of the boys would die that day. They were using completely unorthodox methods that had never been tried or tested. Reporter: Revealing two of the boys nearly didn't make it. One of the boys nearly went hypothermic because his diver got lost and after a while he just stopped in one of these chambers, found some dry ground, put his boy on the side, tried to find something to wrap him in and waited for somebody to come find him, which luckily they did. Another boy stopped breathing when he was sedated. They were given ketamine but we're talking about one boy, one diver in a short tunnel and they couldn't be sure if the boys had died or if something was wrong with them, they didn't know, and they weren't doctors. Reporter: Under a mountain that according to Thai legend is inhabited by a mythical sleeping princess, the boys were marooned a mile and a half into the cave, the entire rescue effort a carefully calibrated human relay, a guideline set up spanning back to the kids and their coach, moving as a cohesive unit, the divers implemented a buddy system to escort each of the boys out. A lead diver tethered to each boy carrying their oxygen tank while the rear diver helped them navigate the twisting maze of those tight underwater passages. It is a tremendous moment here in Thailand. Hard to understate. Reporter: Was that the end of the operation? They still had four Thai Navy S.E.A.L.S in the back of the cave. They had stayed with them for the last few days just to keep up their spirits and to let the boys know, they're not giving up without them. Those guys were willing to die with the boys if it came to that. Those four Thai Navy S.E.A.L.S brought up the rear. They were given extra air tanks to come out and the first one pops out, hooray. Second one, hooray. After the second Thai Navy S.E.A.L. Came out, the pumps broke so the water started rising. Feet within a few minutes. The U.S. Special ops guy describes going through that part of the cave, puckering his lips, leaning his head all the way back and just sucking the little sips of air left on the ceiling and it's incredibly dramatic. It's a time capsule. All the pumps are there, the water bottles, the chairs, all their air tanks by the hundreds were left in there as they abandoned ship. Reporter: What have you learned about the dynamics among the boys and their coach inside that cave? The coach acted as a coach, father figure, priest, meditation leader. He got them into that mess. He also helped keep them alive in the cave. He instituted a regiment where they would dig for part of the day, then rest, then meditate, then talk, then sleep, and he kept their spirits up the whole time. And basically, every boy broke down. They all cried. In fact, the boys started hallucinating in the cave. You're so deprived of all the ambient sound that all you hear is the drip and those drips can turn into any sound your brain wants and this is a really common phenomenon. When they were found, they started talking about all the children they heard and the dogs barking, there must be an exit near us but there wasn't. It was just their minds playing tricks on them. Reporter: The coach turning into a national hero. As for the boys, besides becoming international celebrities, Matt says they are still embracing adventure. When I was there in Thailand, I saw the kids riding bikes around at night and I asked the parents, what's going on? They said, in order to hold on to our kids, we have to let them go. We have to let them be the adventurers they were before. And that's the only way that they're really going to recover is by being them.

This transcript has been automatically generated and may not be 100% accurate.