Chiang Rai governor and operation chief Narongsak Osottanakorn said the children were healthy and taken to the Chiang Rai hospital.
The rescue mission has concluded for the night and will resume in 10 to 20 hours because of low oxygen levels.
The first two boys were extracted from the cave around 5:40 p.m. local time Sunday with the help of divers.
The rest of the Thai soccer team and their 25-year-old coach remain inside the Tham Luang Nang cave.
Chiang Rai governor and operation chief Narongsak Osottanakorn said at a press conference Sunday that he had met the children and they were in "perfect" health. He added that the rescue mission today was the "best situation."
He confirmed that four boys have been rescued from the cave and taken to the hospital.
The rescue mission has concluded for the night. Osottanakorn said they will resume in 10 to 20 hours because "we've used all the oxygen."
Fifty foreign divers and 40 Thai divers are currently involved in the rescue operation, The Guardian reported, with teams from Australia, the US, UK, and China aiding in efforts. US President Donald Trump said on Twitter Sunday that his government is working "very closely" with Thai officials.
Elon Musk wrote on Twitter that engineers from two of his companies, the aerospace manufacturer SpaceX and the tunnel-construction company Boring Company, were headed to Thailand to lend their assistance.
Thai Navy SEALS confirmed on Facebook that the fourth boy had made it out at about 7:55 p.m. local time.
Officials said the first two boys had been extracted at 5:40 p.m. local time and traveled 0.6 miles (1 kilometer) underwater.
Media was cleared away from the rescue site on Sunday morning. Several ambulances were seen coming to and from the cavesite.
Helicopters were reported over the Chaing Rai hospital.
One of the boys to emerge was a 13-year-old Mongkol Boonpiem, local media has reported. The other boys have not been identified yet. The two have been airlifted to Chiangrai Prachanukroh Hospital in Chiang Rai for medical treatment, 43 miles (70 kilometers) from the rescue site.
The Thai government released a graphic showing how the rescue from the Tham Luang cave would occur.
Two divers would accompany each boy, guided by rope. The boys would then walk from Chamber 3 to the mouth of the cave, which has been mostly drained over the last few days of the rescue operation.
The rescue mission began on Sunday morning, nearly a week since the 12 boys, aged 11-16, and their coach had been discovered on an embankment 2.5 miles (4 kilometers) inside the winding tunnels.
Officials said the rescue could take three to four days to complete depending on the rainfall.
Osottanakorn, the head of the rescue mission, told reporters that the team had rehearsed the plan for several days, and had cleared a sizeable amount of the flooding from the cave.
An Australian doctor who was part of the rescue mission assessed the boys' health on Saturday night and cleared them for the rescue mission, Reuters said.
The boys, with the help of divers, have to navigate through flooded passages that are no more than two feet (0.6 meters) wide in some areas.
Officials said Saturday they were aiming to rescue the boys before seasonal monsoon rains hit, which could flood the caves.
On Friday, officials warned that oxygen levels in the cave dropped from 21% to 15%, complicating rescue efforts. A Thai Navy SEAL commander told reporters he believed there was "a limited amount of time" left to rescue the team, who wandered into the caves on June 23 after soccer practice.
Officials worked to supply the 12 boys and their coach with oxygen through a 3 mile (5 kilometer) cable running through the cave's winding chambers on Friday. The plan was to have the boys swim out of the cave with the help of divers.
"Good night everyone. Good night," the Thai Navy SEALs posted on their Facebook page Sunday night. "Hooyah."