mbulance leaves from Tham Luang cavEa
mbulance leaves from Tham Luang cavEaReuters

All twelve children who had been trapped in a flooded cave in Thailand for over two weeks have been successfully extracted from the cave, authorities confirmed Tuesday.

The last four children and their soccer coach emerged from the cave Tuesday after the first eight children were rescued on Sunday and Monday.

"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 wrote on their Facebook page.

The boys were airlifted to the Chiang Rai hospital following their rescue.

A doctor and three navy seals who participated in the rescue remain inside the cave.

The successful completion of the rescue of all of the children and their coach brings the crisis which gripped the world for 18 days to an end.

A diving team first located the children on July 2, nine days after they went missing.

A large-scale rescue operation was launched Sunday to bring the entire team out of the cave. The boys and their coach were given diving lessons in preparation for the dangerous journey through the treacherous waters.

Four boys were rescued from the cave on Sunday, with expert divers helping the children navigate their way through the tight passages of the flooded cave in near-total darkness.

The first rescue attempt was cut short, however, after authorities were forced to spend hours replenishing the search and rescue teams' air tanks.

On Monday, divers began the second rescue attempt and removed four more children from the cave before having to call off the rescue again.

The rescue mission took three days in total. Five Thai divers and thirteen foreign divers are participating in the rescue mission.

Each child is accompanied by two divers during the journey out of the cave, which involves swimming through narrow, dark tunnels with sudden turns and twists.

The rescue was considered critical due to falling oxygen levels in the cave as well as the new rainfall which is expected this week and would cause the cave to flood even further.

The danger the boys and their rescuers faced was underscored when a former Thai Navy Seal involved in the rescue effort died after running out of oxygen on Friday.