The 12 Thai soccer players and their coach who have been trapped in a cave in northern Thailand for more than two weeks have all been rescued. “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 Thai Navy SEALs posted on their Facebook page.

The dramatic story of the boys who hiked into the Tham Luang Nang Non cave system on June 23 and then became trapped by floodwaters has riveted people around the world. It took an increasingly happy turn over the last three days, as an international team of divers brought out the boys in three stages.

Tuesday’s rescue mission succeeded in retrieving the remaining four boys and the coach. The last people to emerge from the cave were a doctor and three members of the Thai Navy SEALs at 10 pm Tuesday local time. The boys are in good overall health, according to Thailand’s Ministry of Public Health.

The group was found trapped in the flooded area half a mile below the surface by two British divers a week ago in a chamber some 2.5 miles from the cave’s mouth. (The coach also taught them to meditate to keep calm and they were meditating when they were found.)

Guiding 12 boys through the narrow passageways of the cave, some partially or fully submerged in water, at first seemed like a nearly impossible task — since it took the rescuers five hours to make the journey one way.

And though rescuers initially said they were going to teach the boys to swim out of the flooded cave accompanied by expert divers, on Wednesday, we learned that instead the boys had been given medication and put on stretchers before they were passed from diver-to-diver through the cave. (While CBS reported that the boys were given only anti-anxiety medication, AFP said some were fully sedated.)

“Some of them were asleep, some of them were wiggling their fingers... (as if) groggy, but they were breathing,” Commander Chaiyananta Peeranarong told AFP.

There are conflicting reports on to what extent the boys were medicated for the journey

The diving rescue team was comprised of 13 foreign divers and five members of the Thai Navy SEALs, according to Reuters. The team began its first attempt on Sunday, pairing each boy with two divers. The boys were equipped with full-face masks, which are specifically designed for beginner divers. And the pros who accompanied them carried the boys’ oxygen tanks.

The exact details of the operation are still somewhat unclear as divers were told not to give out information while the risky rescue was still underway.

But the Thai Navy SEALs finally posted a video to Facebook on Wednesday afternoon, showing that the boys were put on stretchers and guided through the passageways.

ปฏิบัติการที่โลกต้องจดจำ The operation the world never forgets. 18 วัน ที่ผู้คนทั้งโลกรวมใจมาอยู่ด้วยกัน รวมพลังช่วยกันพานักฟุตบอลทีมหมูป่าอะคาเดมี 12 คนและโค้ช กลับบ้าน และเราจะจดจความเสียสละ ความงดงามในจิตใจของเรือโทสมาน กุนัน ตลอดไป Hooyah Hooyah Hooyah Posted by Thai NavySEAL on Wednesday, July 11, 2018

A diver who spoke to the AFP said the boys were “sleeping” as he helped guide them on stretchers. And since the medic in the cave, Richard Harris, was an anesthetist, he may have overseen that part of the rescue effort.

But the BBC also outlined some of the conflicting reports surrounding the extent to which the boys were medicated:

Sources in the rescue operation, including divers who took part, told the BBC that the boys were heavily sedated ahead of the rescue to prevent them panicking in the dark, narrow, underwater passageways. They were then strapped to one of two rescue divers tasked with shepherding each boy through the underwater parts of the system, and bundled into stretchers to be carried through the dry parts. There were conflicting reports in the hours after the rescue about the extent to which the boys had been medicated before they were brought out... Several sources have since confirmed that the boys were only partially conscious as they were brought out.

“The operation went much better than expected”

The most dangerous part of the journey was traversing a “pinch” point that is only 15 inches wide, according to CBS. Because it’s so narrow, the boys were separated from their chaperones there. This was risky, given that the section was nearly pitch black.

The first part of the 2.5-mile journey required wading and diving through the flooded passages, according to ABC Australia. Next came a 1-mile climb over slippery rock, with ropes for assistance.

Overall it took about nine hours for divers to get the first group of four boys out of the cave.

“The operation went much better than expected,” acting Gov. Narongsak Osatanakorn of Chiang Rai, Thailand, said, according to the Associated Press.

The second mission, which began at 11 am local time on Monday, resulted in four more boys emerging from the cave. And Tuesday morning’s mission for the last four and the coach took just eight hours.

Edd Sorenson, a member of the National Speleological Society-Cave Diving Section, told Vox that dry rescue situations like this one — where the trapped people are not fully submerged — are usually safer than wet rescue scenarios. But this rescue has been complicated by the flooding.

“Water can be very violent, and this is a very difficult [cave rescue] because of the extreme high flow, the zero visibility, the boulder pile chokes, restrictions,” he said.

After the boys emerged from the cave, they were taken in ambulances to evacuation hospitals, which flew them to the Chiang Rai Prachanukroh hospital. They must be quarantined for a few days until doctors can be sure that they haven’t caught any transmissible diseases from their time in the cave. So for now, their parents have only been able to see them through a glass window.

“I cannot understand how cool these small kids are, you know?” Karadzic said. “Incredibly strong kids. Unbelievable almost.”

Clarification: An earlier version of this piece said that the boys swam out of the cave with the help of expert divers. New information that became available Wednesday indicated that in fact they were given an anti-anxiety medication or sedative and wrapped on stretchers as the expert divers ferried them through the cave system.