The water pumps failed, and Commander Chaiyananta Peeranarong heard shouts of alarm as the final stage of an unprecedented operation to rescue 12 Thai boys and their coach from a flooded cave almost tipped into disaster.
The former Navy SEAL, 60, says he was the last to leave the Tham Luang cave after the 12 "Wild Boars" and their football coach were was safely extracted in a three-day operation that ended on Tuesday in jubilation.
But the mission, which leaned on the expertise of elite foreign divers and Thai Navy SEALs, nearly turned into a calamity.
Shortly after the last four boys and the 25-year-old coach were brought out Tuesday late afternoon, the water pumps failed in an area between two chambers, filling them with water as 20 rescuers remained inside.
"Suddenly the Australian guy who was overseeing that area started shouting that the water pump had stopped working," Chaiyananta told AFP.
"If you didn't use the water pump in that location, you could only come out with an oxygen tank," he said, adding the remaining people did not have diving gear to hand.
"By the time the last diver was out the water was already at head level, almost to the point where he needed an oxygen tank."
Heavy rains had flooded the Tham Luang cave blocking the football team in after they first entered on June 23.
Thailand's junta leader Prayut Chan-O-Cha on Tuesday said the boys were given a "minor tranquiliser" to keep them calm.
But Chaiyananta, whose job was to help transfer the kids along between chambers two and three, said they were all "sleeping" on the harrowing journey out.
"We just needed them to know how to breathe and not panic in the water," he said.
Footage released by the SEAL team showed seemingly prone boys -- at least one in full diving mask and wetsuit -- being stretchered along the jagged passageways.
Doctors, divers and other rescuers were posted along the twisting corridors monitoring the boys as they were passed through using a system of ropes, pulleys and rubber piping.
- Fraught with danger -
Two days before the dramatic rescue bid began, another retired SEAL, Saman Kunan, died trying to set up oxygen tanks in a flooded tunnel.
Saman's death, the only casualty in the operation, was widely mourned.
"I want this warm hug once again," his widow Valeepoan said on Instagram, posting a photo of her and Saman embracing.
The world held its breath over the three days it took to retrieve the Wild Boars.
All are recovering at a hospital in northern Thailand's Chiang Rai province, where video showed several of them in seemingly good spirits, waving and flashing peace signs to the camera.
The exact mechanics of the rescue bid were closely guarded during the operation, but details have since dribbled out.
Experts say the divers brought a variety of skills, including the ability to install guide lines that help in low visibility, and previous experience in international operations.
But one man has emerged as a pivotal figure in the most unlikely of rescues -- Australian diver and anaesthetist Richard "Harry" Harris.
Without him "this mission may not have succeeded", the Thai rescue chief, Narongsak Osottanakorn, told reporters late Wednesday.
The website of Harris' medical company based in Adelaide describes him as someone who combines a "taste for adventure with his medical practice and a lifelong interest in the underwater world."
In a statement, Harris and his dive partner Craig Challen expressed relief at the success of the painstaking operation.
"The favourable outcome that has been achieved is almost beyond our imagination when we first became involved," they said.
Two of the 13 frontline foreign expert divers, British pair Richard Stanton and John Volanthen, were the first to locate the team on a shelf several kilometres inside Tham Luang nine days after they went in.
Volanthen received a standing ovation as part of a hero's send-off at Bangkok's Suvarnabhumi airport on Wednesday as they left the country.
"We were able to do the job we were asked to do," said the diver, who like most of the divers assiduously avoided the media during the operation in a mission defined by steely resolve.
When asked if he had a message for Thai kids, he told them not to go into a cave when it's raining, eliciting laughter.