All 12 boys from the Wild Boars football team are now free, according to reports on the ground. The final boy emerged into the daylight at around 6pm local time (11pm NZ time).
The coach is understood to also have left the cave. Behind them are a doctor and several Thai Navy SEALs.
The eleventh boy came to the surface at 5.15pm local time (10.15pm NZ time), the tenth at around 4.30pm local time (9.30pm NZ time) and the ninth just minutes earlier at 4.06pm.
The Australian's Amanda Hodge has reported that Adelaide anaesthetist Richard Harris has continued to play central role in the rescue, diving each day all the way to where the boys are trapped to check their condition before clearing them to dive.
"He only leaves the cave when the last boy is rescued each day," she said.
It's an extraordinary end to a mission many said was impossible. To rescue a group of children trapped 4km underground and teach them to dive their way out of flooded caves and tunnels the Tham Luang Nang Non cave system far worse.
Earlier, at least nine ambulances were waiting at the site after the leader of the rescue operation earlier said the aim was to bring out all five of the football group as well as a medic and three Thai Navy Seals, who have been with the trapped boys.
Officials generally waited hours to confirm rescues.
Health experts have given the eight who were rescued on Sunday and Monday a chocolate treat and described them as being in good spirits.
Chiang Rai Governor Narongsak Osatanakorn said Tuesday's intricate and high-risk operation began just after 10am local time and involves 19 divers. A medic and three Thai Navy SEALs who have stayed with the boys on a small, dry shelf deep in the flooded cave will also come out, he said.
"We expect that if there is no unusual condition ... the four boys, one coach, the doctor, and three SEALs who have been with the boys since the first day will come out today," he told a news conference to loud cheering.
Nargonsak said this phase may take longer than the previous two rescue missions, the longer, first missing taking 11 hours.
The eight boys brought out by divers over the previous two days are in "high spirits" and have strong immune systems because they are soccer players, a senior health official said.
Doctors were being cautious because of the infection risk and were isolating the boys in the hospital. They did get a treat, however: bread with chocolate spread that they'd requested.
The plight of the boys and their coach has riveted Thailand and much of the world — from the heart-sinking news they were missing to the first flickering video of the huddle of anxious yet smiling boys when they were found 10 days later by a pair of British divers.
They were trapped in the Tham Luan Nang Non cave that became flooded by monsoon rains while they were exploring it after a soccer practice on June 23.
At a news conference, Jedsada Chokdumrongsuk, permanent secretary at the Public Health Ministry, said the first four boys rescued, aged 12 to 16, are now able to eat normal food, though they can't yet take the spicy dishes favored by many Thais.
Two of the boys possibly have a lung infection but all eight are generally "healthy and smiling," he said.
"The kids are footballers so they have high immune systems," Jedsada said.
"Everyone is in high spirits and are happy to get out. But we will have a psychiatrist to evaluate them."
It could be at least seven days before they can be released from hospital, Jedsada told a news conference.
Family members have seen at least some of the boys from behind a glass isolation barrier, and Jedsada said doctors may let the boys walk around their beds Tuesday.
It was clear doctors were taking a cautious approach. Jedsada said they were uncertain what type of infections the boys could face "because we have never experienced this kind of issue from a deep cave."
If medical tests show no dangers, after another two days parents will be able to enter the isolation area dressed in sterilized clothing and staying 2 meters away from the boys, said Tosthep Bunthong, Chiang Rai Public Health Chief.
The second group of four rescued on Monday are aged 12 to 14.
Four ambulances and a convoy of other vehicles arrived at the cave site Tuesday morning to prepare for the third phase of the rescue.
Heavy rains in the morning cleared during the day, a reassuring sign for rescuers who have feared monsoon rains could imperil the rescue.
Officials scotched any chance of using tech billionaire Elon Musk's mini sub made of rocket parts to rescue the remaining boys.
Narongsak said he was grateful for Musk's support but the equipment was impractical for the rescue mission.
Musk on Tuesday visited the cave and posted pictures and videos online. He said he left the equipment there in case rescuers could use it in the future.