"Thai Navy SEALs have found all 13 with signs of life," Narongsak Osottanakorn, the governor of the Chiang Rai province, told reporters.
Rescuers are now working to extract the team from the cave.
The Thai Navy SEALs posted a video on Facebook showing the group when they were first found. The boys appeared to be in good health and were talking, asking what day it was and being told by rescuers that more help was on the way.
"I am very happy," one of the boys said in English. "Thank you so much."
A British diver on the SEAL team told the group, "You have been here 10 days. You are very strong."
One of the boys asked him, "What time do we go outside?"
The diver responded, "No, not today, not today. There's two of us. You have to dive. We're coming. It's OK. Many people are coming. Many, many people. We're the first. Many people come."
The divers provided the group with lights and told them food and medical help were on the way.
"Where are you from?" one of the rescued boys asked.
The diver answered, "England, the UK."
"God bless you," another member of the rescued party was heard saying.
When a Thai military official announced the rescue at a base camp near the mouth of the cave, loud cheers went up from the searchers, who had been praying and working feverishly for such an outcome.
Aisha Wiboonrungrueng's 11-year-old son, Chanin Wiboonrungrueng, was among rescued.
"He would love to eat a fried omelet," the ecstatic mother told reporters.
Ben Reymenants, a Belgian diver who is part of an international contingent that had been searching for the soccer team, said he was briefed by an operation commander on the rescue. He said the children and their coach were weak when they were found and that a medic was now with them in the cave, providing medical assistance.
Reymenants told ABC News the race is on to safely remove the group from the cave over the next 12 hours before the next rainstorm hits.
The miraculous rescue came during a lull in the torrential rains that had hampered the agonizing search. The respite from the rain also gave rescuers confidence to push forward in an area of the subterranean labyrinth they had hoped the boys and their coach were waiting to be saved.
Gov. Osottanakorn said the rescuers reached the area known as Pattaya Beach where they thought they would find the lost group. When they arrived the area was flooded. He said the rescuers forged ahead about another 1,000 feet, where they discovered the boys and their coach.
"It is another high ground," Osottanakorn said of where the group was located. "We found that our younger brothers are safe."
Reymenants said the team was found in the dark and wet underground web of tunnels in the jungle of northern Thailand about a day after rescuers spotted fresh writing on a wall of one of the passageways.
"I'm feeling so happy. This is like out of a movie, truthfully," U.S. Air Force Capt. Jessica Tait, a spokeswoman for the 353rd Special Operations Group, told ABC News at the base camp near the entrance to the cave.
"I felt elation. I felt so excited," she said of getting the news that the team had been located.
The 12 boys, ranging in age from 11 to 16, and their coach went missing after entering the Tham Luang Nang Non cave for an excursion on June 23.
Officials believe the team became trapped when monsoon rains flooded passages and blocked their path back to the entrance of the cave where authorities found their bicycles.
Rescuers were hoping to find the group in the dryer part of the cave, where nooks, crannies, chambers and tunnels run six miles beneath the rugged mountains near the borders of Myanmar and Laos.
Divers had to pull themselves along with rope against powerful currents in the cave's water. The visibility was so poor that one rescuer described it as swimming through coffee.
The rescue operation had gripped the attention of Thailand and beyond as people across the region collectively prayed for a miracle in the search that had entered its tenth day on Monday.
Crews of geologists working outside the cave have been drilling into the grottos to create potential escape shafts closer to the area where rescuers had hoped to find the wayward party. Crews have also been working above ground to pump flood waters out of the cave to give rescuers better access to search passageways.
Before the jubilant announcement of the rescue, officials conceded they were in a desperate race against time and weather. Meteorologists were forecasting a 30 to 40 percent chance of thunderstorms in the northern region of the country on Wednesday.
About 1,000 volunteers and rescuers, including a U.S. military team, had established a base camp near the mouth of the cave. Family members of the lost group were also in the area monitoring any news from rescuers and praying at a makeshift shrine.
Search teams from China, Japan, Australia and England had also traveled to the area to assist in the rescue operations.