Image copyright EPA / Thai Navy Image caption The Thai military (pictured) and civilians have joined forces to try to save the boys

Teams have a three to four-day window to save 12 Thai boys and their football coach from a cave where they have been trapped for two weeks, according to the leader of the rescue efforts.

Narongsak Osottanakorn said conditions were currently "perfect".

There is concern that monsoon rains could follow, further flooding the narrow passages.

Media and all non-essential personnel were told to leave the site near the cave entrance early on Sunday.

Police said the area was needed for a rescue operation, although they did not specify whether one was imminent.

The boys were exploring the cave when they and their football coach became trapped by rising waters on 23 June.

Rescue divers have since been able to take them food, oxygen and medical assistance, while a huge international team works on a plan to free them.

"Now and in the next three or four days, the conditions are perfect [for evacuation] in terms of the water, the weather and the boys' health," said Mr Narongsak, governor of the Chiang Rai province, where the caves are.

"We have to make a clear decision on what we can do."

Media playback is unsupported on your device Media caption Thailand cave rescue: Meet the volunteer helpers

There was a short burst of heavy rain on Saturday night after he spoke, and it is unclear whether this will have affected the plans.

Earlier in the day, the Thai Navy Seals released the letters the boys sent to their families, via rescue divers, reassuring them.

"Don't worry, we are all strong," one child said in a note. "Teacher, don't give us lots of homework!" he joked.

Another wrote: "Nick loves Mum and Dad and siblings. If I can get out, Mum and Dad please bring me mookatha [Thai barbecue] to eat."

The football coach who took the boys into the cave apologised to parents, but several of them have said they do not blame him.

What is the plan?

A huge military and civilian operation is racing against the clock to bring the group out amid high risks.

The danger of the situation became clear when a former Thai navy diver died after delivering air tanks to the group on Friday.

The boys are currently perched on a dry shelf, but rain could reduce that space to "less than 10 sq m (108 sq ft)", Mr Narongsak said.

Media playback is unsupported on your device Media caption Dr Alex Rowe explains the impact of being trapped underground

Officials say an oxygen line has been installed to counteract the increased carbon dioxide that comes from so many people breathing within such a small area.

Bore holes have also been drilled into the rock to try to drain water out and give the boys more time.

It has previously been said that they could be underground for months, either learning to dive or waiting for the water to recede or be pumped out.

Media playback is unsupported on your device Media caption Heavy rain is not expected until late in the week in the area where the boys are trapped in a cave

Earlier on Saturday, Mr Narongsak said the boys had not yet learned the diving skills to allow for their safe passage.

Separately, billionaire technology entrepreneur Elon Musk, who has offered his assistance to the rescue operations, said he had received "more great feedback" from cave experts in Thailand on two possible rescue options his team have been working on.

Musk said on Twitter than one potential solution involved an "kid-sized submarine", while another was an "inflatable tube with airlocks". It is not clear if either will be used in the rescue operations.

The ideal scenario is for enough water to have been pumped out to allow the group to climb out.

Mr Narongsak has not specified the course of action for these next few crucial days.

How did this happen?

The boys were found inside the cave by British rescue divers on Monday, about 4km (2.5 miles) from the cave mouth.

Aged between 11 and 16, they belong to a football club called the Wild Boars, and became trapped during an excursion with their coach.

It took nine days to find them in the underground network's dark depths.