A Thai health official said Wednesday that all 12 boys and their soccer coach rescued after being trapped more than two weeks in a flooded cave are in good health, but they still need to be monitored in hospital for at least a week.

International and Thai divers rescued the remaining five from deep in the Tham Luang Nang Non cave in the northern province of Chiang Rai on Tuesday, after extracting four each on Sunday and Monday.

The 13 are recovering in hospital in the provincial capital.

(Onlookers watch as an ambulance transports rescued boys to hospital on July 10)

During a press conference in the evening, video footage was shown of the boys and coach recuperating in two groups in the hospital, with many of them making gestures with their hands to show that they are fine and in good spirits.

Parents could be seen standing outside the room, some of them in tears. Those of the four rescued Sunday have been allowed to visit them on condition they keep a distance and wear gowns to prevent infection.

Thongchai Lertwilairatanapong, a senior health ministry official, earlier told reports that one of those rescued Tuesday is being treated for a slight lung infection, but they are fine.

He said the four who were rescued Sunday have begun eating regular food, while those brought out Monday are also well and are expected to resume normal meals by the end of Wednesday.

The boys will be monitored for one week at the hospital and for another week at home, according to their doctors.

As to their mental health, Thongchai said the doctors have not seen signs of stress but a team of psychologists will follow up.

(Thai public health officials talk about the boys' conditions)

The Wild Boar soccer team members had entered the cave on June 23 and were subsequently trapped by rising flood waters. Amid a frantic search by hundreds of rescuers and support personnel, they were found about 4 kilometers inside on July 2.

Thai Prime Minister Prayut Chan-o-cha has expressed his appreciation and gratitude to the rescuers and for the support and congratulations that had poured in from across the globe.

"This mission has clearly shown that with conscious, determination, unity and sacrifice, we can overcome any obstacles," he said.

The whole rescue operation involved some 90 divers, including dozens from 15 foreign countries such as Britain, the United States and Australia.

The Thai navy SEALs posted a message on Facebook saying, "We will never forget these 18 days when everyone around the world came in unity to bring the 12 boys and their coach from Moo Pa (Wild Boar) Academy soccer team home."

(The last four Thai navy SEALs emerge from the cave) 

"Sacrifice, bravery and a beautiful heart of Samarn Kunan will be remembered forever."

The reference was to a former SEAL diver who died in the cave last Thursday. Prayut also eulogized him by saying, his "honor, sacrifice and legacy will forever be in our hearts."

His widow Waleeporn Kunan told local media that she was delighted to see the soccer team members rescue and that she hopes to see them recover fully and resume soccer practice.

"I support you all. Keep practicing football and become national footballers," she said.

According to the British Cave Rescue Council, the spearhead group of cave divers during the three-day extraction consisted of four British and two Australians, one of whom was a doctor.

After the doctor examined the boys, they were kitted out with wetsuits and diving equipment and then each was guided out by one of the British divers, passing support divers who were strategically placed at intervals on the way.

The doctor has been identified as Richard Harris, a cave-diving expert from Adelaide who stayed with the boys during their remaining days in the cave and gave the medical all-clear for each evacuation.

Glen McEwen, an Australian police commander, told a press conference in Chiang Rai that Harris, who was the last one out of the cave, was an "essential component" of the rescue operation.

(Onlookers cheer as the last schoolboys and their coach are rescued from the cave)

A video clip showed Harris telling Australian Prime Minister Malcolm Turnbull via FaceTime that the "big heroes" were the 12 children themselves, and the Thai Navy SEAL divers who looked after them in the cave.

"They're toughest blokes and kids I've ever had the privilege to meet," he said. "They are the ones who were responsible for their own morale and really their own safety, and without them being in the state they were in, we couldn't have done anything."

He said the entire dive from over 2 kilometers back in the cave was in zero visibility and the last couple hundred meters was especially difficult to dive through.

"You're following the line with your hands...with a small boy being cradled in your arms and feeling your way through between rocks and posting yourself sideways through little holes and things," said Harris, who is currently grieving for his father who died shortly after the end of the mission.

U.S. Air Force Master Sgt. Derek Anderson, who led a team dispatched by the U.S. Indo-Pacific Command, told Kyodo News in an interview that the rescue operation was "absolutely one of the most difficult" his team had ever faced.

"This has never been done before. In the history of cave rescue, people have never taken this many children, in this dangerous of a cave, underwater this many times, with zero visibility...so we just didn't know the outcome," he said. "We knew that it was very high risk."

Anderson said the boys were provided with specialized, child-size full face masks so that they could breathe normally without a regulator during the long diving portions of the extraction that sometimes lasted as long as 30 minutes.

Earlier, cave rescuers enlisted the help of volunteer children from a nearby school, practicing with them in a pool near the cave site to see if all the equipment fit and worked well, he said.

Various precautions were taken, such as filling regular scuba tanks with 80 percent oxygen instead of 20 percent "so if there was a problem, they'd have a better chance underwater with more oxygen."