Disaster has been averted in Thailand thanks to a daring rescue mission that produced amazingly successful results.

All 12 members of a boys soccer team and their coach now have been safely rescued from a cave in Thailand after being trapped there for 18 days, the Thai Navy SEALs announced Tuesday morning in a Facebook post.

“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 post read.

The group was exploring the Tham Luang Cave after a June 23 practice when monsoon rains flooded the cave and blocked their exit.

What followed was a massive search-and-rescue operation involving hundreds of divers and volunteers, who finally spotted the boys and their coach 10 days after they went missing. A team of Thai and international divers extracted eight of the boys Sunday and Monday using a complex system that involved laying out oxygen canisters at regular intervals to guide them out of the flooded cave.

The remaining four boys and the 25-year-old head coach were rescued around Tuesday afternoon local time and were taken to a local hospital.

The rescue mission wasn’t without tragedy: A retired Thai Navy SEAL officer, identified as 38-year-old Saman Gunan, died while placing oxygen canisters along the escape route after he ran out of air.

The Thai Navy SEALs said they still were waiting on four SEAL personnel to come out of the cave after they stayed with the boys on a dry shelf inside the flooded cave.

UPDATE (10:58 a.m. ET): The remaining four SEAL personnel have exited the cave safely, according to CNN.

Thumbnail photo via Ron Chenoy/USA TODAY Sports Images