* First two boys out - Thai heath official

* Rescue mission could take 3-4 days to extract entire group

* Rain threatens to hamper rescue effort

* Elon Musk offers mini-sub (Adds details of first boys emerging)

By Patpicha Tanakasempipat and Panu Wongcha-um

CHIANG RAI, Thailand, July 8 (Reuters) - The first two schoolboys have emerged from a flooded Thai cave after divers launched a daring and dangerous mission to rescue the children and their soccer coach, who have been trapped underground for more than two weeks, a Thai official said.

"Two kids are out. They are currently at the field hospital near the cave," Tossathep Boonthong, chief of the health department in Chiang Rai in northern Thailand, told Reuters. "We are giving them a physical examination."

Thirteen foreign divers and five members of Thailand's elite navy SEAL unit are trying to bring the rest of the boys - some as young as 11 and weak swimmers – through narrow, submerged passageways that claimed the life of a former Thai navy diver on Friday.

Their ordeal has drawn huge media attention in Thailand and abroad, and getting the boys out safely could be a boost for Thailand's ruling junta ahead of a general election next year.

"Today is D-Day," Narongsak Osottanakorn, head of the rescue mission, had earlier told reporters.

Bursts of heavy monsoon rain soaked the Tham Luang Cave area in northern Chiang Rai province on Sunday and storms were expected in the coming weeks, increasing the risks in what has been called a "war with water and time" to save the team.

The boys, aged between 11 and 16, went missing with their 25-year-old coach after soccer practice on June 23, setting out on an adventure to explore the cave complex near the border with Myanmar and celebrate a boy's birthday.

Rescuing them all could take three to four days and depended on the weather, an army commander involved in the mission said.

The rescue teams had rehearsed the plan for several days, Narongsak said, and had managed to drain the water level in the cave considerably, but needed to move fast.

"If we wait and the rain comes in the next few days we will be tired again from pumping and our readiness would drop. If that's the case, then we have to reassess the situation," he said.

An Australian doctor who is part of the rescue mission checked the health of the boys on Saturday night and gave the all-clear for the operation to proceed.

The boys were discovered by British divers Richard Stanton and John Volanthen on Monday.

Of the 13-strong foreign dive team - mainly from Europe - three were escorting the children, while the remainder were positioned along the dangerous first kilometre stretch, where the boys will have to navigate through submerged passageways in some places no more than two feet (0.6 metre) wide.

MEDICAL TEAMS ANXIOUS

Thirteen medical teams were stationed outside the cave - each with its own helicopter and ambulance - one for each of 12 boys and their coach. After an initial assessment at the site, the boys will be airlifted to a makeshift helipad close to the Chiang Rai Prachanukroh hospital, some 70 km away.

A source at the hospital said that five emergency response doctors were awaiting the party and a further 30 doctors were on stand-by, adding that everyone was feeling tense.

"The teams here are happy the boys are being rescued but also anxious about the severity of the boys' conditions. We're under a lot of pressure," she said, declining to be named because she was not allowed to speak to the media.

The area outside the hospital was cordoned off with police patrolling the area, said a Reuters reporter at the scene. Down the street, a loud speaker told vendors to "keep off the road" and to "not obstruct the transfer mission".

Prime Minister Prayuth Chan-ocha, leader of the military junta that seized power in 2014, planned to visit the cave site on Monday, a government spokesman said.

His visit with relatives and rescue officials last week was criticised by some Thais as opportunistic as his government faced pro-democracy protests in the capital Bangkok in recent months.

A team from a company owned by billionaire entrepreneur Elon Musk with drilling and exploration expertise was expected to reach the cave site on Sunday, Thailand's defence ministry said.

Musk said on Twitter a team from his rocket company SpaceX in Los Angeles was building a "tiny kid-size submarine" to help with the rescue, although gave a timeline that suggests it would not arrive in Thailand until Monday at the earliest.

(Additional reporting by John Geddie and James Pomfret; Writing by James Pomfret; Editing by Alex Richardson)

Our Standards: The Thomson Reuters Trust Principles.