Death marks the first major setback in mission to rescue the football team.

A former Thai military diver helping to rescue a young football team trapped inside a flooded cave has died as officials warned the window of opportunity to free the team is “limited”.

The diver’s death on Friday raises serious doubts over the safety of attempting to bring the 12 boys and their football coach out through cramped passageways deep inside the waterlogged Tham Luang cave in Thailand.

The team became trapped kilometres deep inside the cave system two weeks ago after floodwaters caused by heavy rains blocked the entrance.

“At first, we thought the children could stay for a long time … but now things have changed, we have a limited time,” Thailand Navy SEAL commander Arpakorn Yookongkaew told reporters on Friday.

In the first official admission that the team cannot wait out the monsoon underground, the commander indicated that rescuers may have little choice but to attempt the tricky extraction of the group.

Oxygen levels inside the cave were getting lower because of all the workers inside, Chian Rai Governor Narongsak Osatanakorn said late on Thursday.

He added that authorities were working to run an oxygen line to reach the team.

‘We will continue our mission’

A sombre mood has clouded the elation from earlier in the week when the boys were found dishevelled and hungry but alive on a ledge kilometres inside the cave.

The diver, identified as Saman Kunont, lost consciousness and died while returning from the chamber where the boys are trapped.

He was working in a volunteer capacity and died during an overnight mission during which he was placing oxygen canisters along the route divers must take to get to the children, according to SEAL commander Arpakorn.

The strategically placed canisters allow divers to stay under water for longer during what is about a five-hour trip to reach the stranded team.

The diver lost consciousness and efforts to resuscitate him failed, Arpakorn said. Another Navy official said he didn’t believe the man’s oxygen tank ran out.

“Despite this, we will continue until we accomplish our mission,” Arpakorn said.

Asked how the boys could make it out safely if an experienced diver could not, Arpakorn said they would take more precautions with the children.

“It’s very risky [diving out]. Think about it, a Navy Seal just passed away last night, so how about a 12-year-old kid,” said Rafael Aroush, a volunteer helping the rescue efforts.

Narrow corridors make the 10km Tham Luang cave system difficult to navigate [Al Jazeera] Narrow corridors make the 10km Tham Luang cave system difficult to navigate [Al Jazeera]

The governor has said the 13 may not be extracted at the same time, depending on their condition. The boys are weak but for the most part physically healthy. They’ve practised breathing while wearing diving masks in preparation for the diving possibility.

Officials prefer to get the boys out as soon as possible because heavy rain expected by Saturday will almost surely raise water levels in the cave again, making passage in some areas even more difficult, if not impossible.

Some areas in the cave complex are so narrow the boys, who do not have diving experience, would have to swim through the muddy waters unaccompanied.

It currently takes rescuers, who are seasoned cave-diving experts, about six hours to reach the ledge where the boys are holding out.

Other possibilities for getting the football team out are finding an alternative entrance to the cave through shafts in the mountainside or waiting until water levels drop until they can walk out.

With monsoon season typically lasting until October, the latter option could take months.