This is how 4 of the boys trapped inside Thailand cave were rescued

The rescue operations were put on hold Sunday night while air tanks and other systems are refilled

Police officers block a road leading to the Tham Luang cave complex

Four of 12 Thai schoolboys were rescued from a flooded cave on Sunday in a daring and dangerous operation to save the children and their soccer coach who have been trapped underground for more than two weeks.

A Royal Thai Police helicopter carrying rescued schoolboys

A helicopter flew the four boys to the nearby city of Chiang Rai, where they were taken by ambulance to the hospital. The area outside the Chiang Rai hospital was cordoned off by police.

Cavers walk on a road leading to the Tham Luang cave complex,

Experienced cave divers have noted how difficult the dive in Thang Luam Cave is. In addition to having no experience diving, the boys have mostly been without food and medicine for two weeks in tight quarters where oxygen is limited.

For the first four rescues, two divers accompanied each boy, one from the side and one from behind.

They made their way back to the entrance of the cave guided by a 3 mile (4.8 kilometre) rope.

Divers walk inside Tham Luang cave complex

The boys had to travel about 2.5 miles (4 kilometres) with oxygen tanks, tethered to cave divers to exit. About 0.6 miles (1 kilometre) of the journey was underwater, where everyone had to wear full face masks.

Over the past few days, the boys were given lessons in swimming and diving before they started their journey out of the cave.

Rescue workers arrive at the Tham Luang cave complex

In total, 13 foreign cave divers and five Thai Navy SEAL divers participated in Sunday's rescue, according to Reuters.The boys had to navigate through flooded passages that are no more than two feet wide in some areas.

A girl shows a collage of pictures of trapped boys

According to the Thai government, when they reached a spot that couldn't fit a person and an oxygen tank, the divers would take the boy's tank off his back while slowly guiding the boy through the narrow passages.

Schoolmates pray next to a banner

The first boys exited the cave several hours before they were expected to – each leg of the journey was estimated to take six hours. Narongsak Osottanakorn, the Chiang Rai governor and head of the rescue mission, said that "today, everything was smooth".

The rest of the rescues were put on hold Sunday night while air tanks and other systems are refilled.