Updated

A Thai soccer team of young boys spent more than two weeks trapped in a cave as rescuers fought heavy rains and depleting oxygen levels to get them out.

By July 10, all 12 players – ranging 11 to 16 years of age – and the 25-year-old coach had been extracted from the cave. The team had to be pulled out over a three day period as Thailand’s annual monsoons flooded the cave, prompting a massive and frenzied search and rescue operation.

Aside from the team, three Thai Navy SEALs and a medic stayed in the cave to help with care, Chiang Rai Gov. Narongsak Osatanakorn said. Workers also labored around the clock to pump water out of the cave.

To get the boys out, experts had to guide them, diving through the cave’s dark, tight and twisting passages.

To get the team out, experts have had to guide them, diving through the cave's dark, tight and twisting passages.

Read on for a timeline of the rescue mission since the team became stuck.

July 18

3bd469cb-Thailand

Members of the rescued soccer team and their coach sit during a press conference discussing their ordeal in the cave in Chiang Rai, northern Thailand. They are recovering well and are eager to eat their favorite comfort foods after their expected discharge from a hospital. (AP Photo/Vincent Thian)

The entire team left the hospital where they had been receiving treatments since their rescue.

Doctors said the boys were able to gain about 6.6 pounds on average since they were rescued from the cave. They had lost about an average of 9 pounds while trapped inside the cave.

TERRIFYING DETAILS OF THAI CAVE RESCUE REVEALED BY DIVERS

During a news conference after their release, the boys put on a quick demonstration of their ball-handling skills in a special miniature soccer field set up in a hall.

July 10 

Thai socceer

The rescued soccer team members pose with a sketch of the Thai Navy SEAL diver who died while trying to rescue them. (Thailand's Ministry of Health and the Chiang Rai Prachanukroh Hospital via AP)

The final four boys and the coach were rescued on July 10, a date officials had hoped would be the final day of rescue efforts.

A total of 19 divers assisted with the rescue operations on Tuesday, Narongsak said.

July 9

thailand cave

One of two ambulances leave the cave in northern Thailand hours after operation began to rescue the trapped youth soccer players and their coach. (AP Photo/Sakchai Lalit)

Four boys were rescued from the cave on July 9, bringing the total saved to eight.

An additional four boys and the 25-year-old coach remained in the cave.

THAI SOCCER COACH, 25-YEAR-OLD FORMER BUDDHIST MONK, HAILED 'HERO' FOR KEEPING BOYS ALIVE

One helicopter carried the sixth and seventh boys to be rescued to a hospital, while the eighth boy was transported on another helicopter for medical treatment.

July 8

The team is stranded nearly 3 miles from the cave's entrance.

The first four boys were rescued from the cave on July 8.

The first boy rescued exited the cave at 5:40 p.m. local time, followed by three of his team members shortly after, Narongsak said. The boys traveled 0.62 miles underwater before they reached safety.

July 6

Kunan

The body of Saman Kunan, a former Thai navy SEAL who died during an overnight mission, is carried during a repatriation and religious rites ceremony at Chiang Rai Airport. (AP Photo)

A former Thai Navy SEAL died after he ran out of oxygen.

Saman Kunan, who was 38 years old, died in the morning after he ran out of oxygen and passed out. Kunan had left the SEALs in 2006 to work at Bangkok’s airport as an emergency rescue officer.

WHAT IS CAVE DISEASE? THAI SOCCER TEAM PLACED IN ISOLATION AS DOCTORS MONITOR FOR INFECTION

A volunteer with the rescue efforts to save those trapped in the cave, Kunan was replacing air tanks along the route to where the soccer team is stranded in order to replenish the air supply in the cave, The Evening Standard reported.

July 2

Thai cave

In this July 3, 2018, image taken from video provided by the Thai Navy Seal, Thai boys are with Navy SEALs inside the cave, Mae Sai, northern Thailand. (Thai Navy Seal via AP)

Divers located the missing team on July 2 — more than a week after they had disappeared.

June 23

Twelve young members of a youth soccer team and their 25-year-old assistant coach entered Thailand's Tham Luang Nang Non cave on June 23 after a practice match. They were cut off from exiting the massive cave when a rainstorm flooded the exit.

Fox News’ Benjamin Brown, Melissa Chrise, Edmund DeMarche, Travis Fedschun, Chris Irvine, Katherine Lam and The Associated Press contributed to this report.