Rescuers in Thailand have retrieved the first of the 12 boys who have been trapped with their soccer coach in a cave for two weeks.

Thai navy SEALs say four soccer team members have been taken out of the cave.

The boys and their coach had been stranded in Tham Luang Nang Non when they went exploring in the cave after a scrimmage June 23. Monsoon flooding cut off their escape and prevented rescuers from finding them for almost 10 days.

Chiang Rai province acting Gov. Narongsak Osatanakorn, who is heading the operation, said earlier Sunday that 13 foreign and five Thai divers were taking part in the rescue, and two divers will accompany each boy as they are gradually extracted.

When the first two rescued boys made it out of the cave, they were placed into ambulances, taken to a helicopter and rushed to a hospital. It is expected that all of the rescued boys and the coach will be taken to the hospital for treatment.

The entire operation to get all 13 out of the cave could last two to four days, depending on weather and water conditions, army Maj. Gen. Chalongchai Chaiyakam said.

The only way to bring them out of the cave is by navigating dark and tight passageways filled with muddy water and strong currents, as well as oxygen-depleted air. A former Thai navy SEAL passed out making the dive Friday and died.

Mild weather and falling water levels over the past few days had created optimal conditions for an underwater evacuation that won't last if it rains again, Narongsak had said.

The Associated Press contributed to this report.