MAE SAI, Thailand — The generals and other officials overseeing the desperate operation to rescue 12 young soccer players and their coach from a flooded cave labyrinth in Thailand’s sweltering far north were only half joking when they quipped Monday that success was in the hands of the rain god Phra Pirun.

They were celebrating a second day of stunning triumph after divers guided four more boys Monday through tight passages and dank flooded caverns to safety. “Two days, eight Boars,” read a Facebook post by the Thai Navy SEALS of the dramatic rescue that began Sunday, more than two weeks after the members of the Wild Boars soccer team were trapped. Another five still await rescue, including the team’s 25-year-old coach.

The eight rescued boys were recuperating in a hospital from their ordeal huddled together on a tiny patch of higher ground where they had sought refuge after a rainstorm flooded the massive Tham Luan Nang Non cave complex as they were exploring it after soccer practice on June 23. Their families were being kept at a distance because of fears of infection and the emaciated-looking boys were eating a rice-based porridge because they were still too weak to take regular food, authorities said.

Officials lavished praise on the Thai and international divers who, in pairs of two, executed the dangerous rescue mission, guiding the boys, who could barely swim and had no diving experience, through a treacherous 4-kilometer-long (2 1/2-mile) escape route that twisted and turned through the cavern. Highlighting the extreme dangers, a former Thai Navy SEAL died Friday while replenishing the oxygen canisters laid along the route to the boys’ damp refuge.

But the chances of monsoon rains sending torrents of water into the cave and making the rescue effort too risky is never far from the minds of everyone involved in the operation.

Alluding to that worry, the regional army commander offered his thanks Monday to the rain god Phra Pirun, imploring him to “keep showing us mercy.”

“Give us three more days and the Boars will come out to see the world, every one of them,” Maj-Gen. Bancha Duriyapan told a news conference punctuated by applause from the dozens of Thai and foreign journalists and others in attendance.

“I beg Phra Pirun because the Meteorological Department said that from Monday on there will be continuous rain,” Bancha said. “If I ask too much, he might not provide it. So I’ve been asking for three days.”

The plight of the boys, aged 11-16, and their coach, has riveted Thailand and much of the world — from the heart-sinking news they were trapped to the first flickering video of the huddle of anxious yet smiling boys brought back by the pair of British divers who found them after penetrating deep into the sprawling cave.

Then came the letters carried out by the teams of divers who took oxygen, food and medicine to the boys’ refuge as experts pondered whether to dive them out or provision them for months while the monsoon season continues until at least late October.

Writing in elegant Thai script, the boys urged their parents not to worry, adding that they hoped they wouldn’t get too much homework after being rescued and couldn’t wait to eat their favorite foods again.

Their friends were full of optimism — and worry.

Phuwadech Kamnguen, a 14-year-old best friend of one of the trapped boys, said he’s looking forward to eating KFC with the team again.

“Even when my friends have left the cave, I’m worried about their physical well-being. From what I’ve seen in the clip, they did look skinny,” he said.

The boys’ nightmare experience — trapped in claustrophobic darkness by rising waters — resonated across the globe, riveting people both in Thailand and internationally who anxiously watched the news coming from this town along the border with Myanmar. After Monday’s rescues, Prime Minister Prayuth Chan-ocha visited the eight freed boys in the hospital where they had been taken by helicopter.

Chiang Rai province’s acting governor, Narongsak Osatanakorn, who is in charge of the rescue, voiced confidence Monday in the ongoing operation, provided the weather doesn’t take a turn for the worse.

Workers have been laboring around the clock to pump water out of the cave, and officials said Monday that despite heavy downpours overnight, water levels inside the cave did not rise. More worrying, however, oxygen levels in the chamber where the boys sought refuge were falling.

Narongsak said Monday’s rescues involving 18 divers and a support team of 100 had taken nine hours, two fewer than the rescues on Sunday.

“We have more expertise than yesterday,” he said.

That sense of accomplishment was also reflected in the message posted Monday night on the Thai Navy SEALS’s Facebook page announcing the latest rescues. It ended with their fighting cheer, adopted from the U.S. Navy: “Hooyah!”

But bringing out the remaining four boys and their coach could take more than one operation, Narongsak warned.

All preparations, including replacing the oxygen cylinders positioned along the route out in the cave, take at least 20 hours, he said. The safety of the divers, who have meticulously planned the mission, is also paramount.

“If Phra Pirun helps us, we might be able to do it very quickly,” Narongsak said, again invoking the god of rain, who is widely revered in Thailand. “But if Phra Pirun doesn’t help, then it might be a little late.”