MAE SAI, Thailand — A nightmare that began on 23 June for 12 Thai boys and their soccer coach ended Tuesday evening when the last five of the group were taken from a flooded cave in northern Thailand, triggering joy and celebration across the country.

The Thai navy SEALs confirmed that all four boys and the coach were safe.

The rescue was a triumphant close to an audacious rescue, ushering children in diving gear who could barely swim through a dangerous tunnel system that would challenge the most experienced cave divers.

Related: How The Thai Navy Rescued The First 4 Boys From That Isolated Cave In Thailand »

Rescue experts and divers from around the world took part in the carefully-planned operation, with each boy flanked by two rescue divers on the way to the surface.

Coach Ekapol Chantawong, 25, who earlier apologized to families in a note for his role leading the children into the caves so close to the monsoon season, was among the last to leave.

The critical point of the rescue was a very narrow section with a turn, known as T-junction, perilous to navigate even for expert cave divers.

Related: How US Troops Worked To Help Rescue That Trapped Thai Soccer Team »

Tuesday’s rescue was the most challenging yet. Instead of the four boys saved in each of Sunday and Monday’s missions, the final mission had to extract five of the trapped group, plus an army doctor and three navy SEALs who had stayed underground with the boys.

The boys were taken by ambulance and helicopter to a hospital after they came out of the caves.

(Sasiwan Mokkasen contributed to this report. Special correspondent Styllis reported from Mae Sai and Times staff writer Dixon from Beijing.)

———

©2018 Los Angeles Times

Distributed by Tribune Content Agency, LLC.

WATCH NEXT: