The two Australians who helped the Thai football team escape safely from a flooded cave were given diplomatic immunity in case anything went wrong during the rescue, Four Corners can reveal.

Retired Perth vet Craig Challen worked closely with his friend and fellow expert cave diver, Adelaide anaesthetist Dr Richard "Harry" Harris, to medically assess the boys and their coach and get them ready for the rescue operation.

An official source confirmed to Four Corners that Dr Challen and Dr Harris were given diplomatic immunity ahead of the risky mission, after negotiations between Australian and Thai Government officials.

Jason Mallinson is a member of the British Cave Research Council Diving Team and he spoke exclusively to Four Corners.

He was handpicked for the rescue job by the two British divers who originally found the boys and their coach huddled together.

"The first thought is they're not going to get out. We've done recoveries before with live people and it's all about panic in the water," he said.

"You can tell a kid whatever you want, but in an actual situation where you've got a kid in the water, they're more than likely going to panic."

Sorry, this video has expired Jason Mallinson and a team of international experts assembled for the Thai cave rescue.

The divers detailed how the boys and their coach were anaesthetised for the extraction, and Mr Mallinson said without Dr Harris, the mission would have failed.

"He was the lynchpin of the whole operation. Without him, we wouldn't have been able to do what we did," he said.

"His bedside manner when he was there with the kids and that, talking to them, calming them down and stuff like that, he was the one that sort of sent them on their way and we were just the transporters."

A phone call and a change of plans

Dr Challen and Dr Harris were crucial to the rescue operation but almost missed the Thai Government's call for help.

"I [was] packed up ready to go for a trip to the Nullarbor. Harry and I were on the way the next day. And so, I had 45 minutes to head to the airport," Dr Challen said.

"In that time, I had to unpack everything that I had, reconfigure and get the gear that I needed for this trip and go."

The pair arrived in northern Thailand on July 6. Dr Challen said they dived into the flooded Tham Luong cave together the next day.

"Saturday afternoon and Harry and I are going in to look at the boys and the coach and see what sort of state they're in," he said.

"Very pleasantly surprised really about that, I mean they're really keeping in good spirits.

"They've got the four Thai Navy SEALs in [there] with them and those guys just did a fantastic job of looking after the boys and keeping morale up. So everything was looking really good in there.

"They've had a few days of being fed after their nine days without any food and very little water.

"Some of them are pretty small and fragile, and a couple of them are only 30 kilos, so they're tiny little things really.

"They're starting to get cold after that time of exposure. I'd say on that first dive, we were only in there for 45 minutes or so, Harry's really just checking their physical condition and looking around and seeing how we're going to do it."

Rescue divers say the Wild Boars were keeping in good spirits inside the cave. ( Supplied )

The US Mission Commander, Air Force Major Charles Hodges, said the decision to rescue the boys by diving them out was a last resort.

Keeping the Wild Boars football team in the cave until the waters receded was ruled out, as it would be four to five months before the monsoon season ended.

"If you go at minimum rations of one meal a day, we were looking at numbers about 1,800 meals that we needed to get in there," he said.

"So, there was not the physical space in the cave to put 1,800 meals and that would be 18 separate dive missions.

"We knew that that wasn't an option because the rains would come too soon for us to be able to execute all of that."

Divers trained with local kids in nearby pool

International rescue divers prepare to enter the cave after the boys and their coach were found. ( AP: Sakchai Lalit )

Air Force Master Sergeant Derek Anderson was the US Dive Operations Commander.

He said his team and the international dive experts began rehearsing in earnest the day before the rescue operation.

They gathered some local children and headed to a swimming pool at a nearby school.

"We had asked the Thai Navy SEALs, 'Hey, we should probably get some kids that are around the same size, age and stature of the ones that we know are in there, and we should go put all this equipment on them, like, that, let's just really run this to the ground'," he said.

"The children were absolutely happy to help. We had divers and Thai children practising swimming underwater, practising handing them off."

Mr Mallinson said inside the flooded cave, they were also practising with the Wild Boars team and their coach.

"We'd get out of the water in the chamber and talk to them about what was involved. We would get out and kit them up with the correct kit," he said.

"They'd get into the wetsuit. We'd put them in a buoyancy jacket, bring them down to the water, put them in the full face mask and check that the seal was good and make sure they were breathing okay."

Mr Mallinson said the risks of the operation could not be overstated.

"The two things that were going to kill them was [if] the full face mask would become dislodged and they'd get water in the mask, and there was nothing we could do about that underwater. We didn't have a backup device for them. It was that mask or nothing," he said.

"The other thing is that if their air ran out."

How the operation unfolded

Rescue workers crouch down as they transfer a stretcher through Tham Luang Cave. ( Facebook: Thai Navy SEAL )

Over the three days of the rescue extraction, Dr Harris stayed in chamber nine with the Wild Boars boys, keeping them calm and preparing them one-by-one to be brought out.

Mr Mallinson was one of four British divers transporting the boys from chamber nine through to chamber three.

He said they dived underwater through the dark, narrow and winding passage, with a child in their arms.

Sorry, this video has expired Thai Navy SEALs released a montage of the mission to rescue the trapped soccer team.

"I would take a kid from chamber nine and bring him the whole way out. So, it's probably five or six flooded sections. We'd either have them on the right-hand side or the left-hand side, either holding their back or holding their chest," he said.

"The first day, [there was] reasonable visibility. I could see sort of a metre in front of me so I didn't have to hold onto the line. By the last day, it was nil visibility.

"It was much more mentally exhausting, and I had to have the lad really close to me so my head was bashing the rocks first. The visibility was that bad, you couldn't see the rock until you actually hit it."

Rescue workers carry a stretcher over rapid flowing floodwater in Tham Luang Cave. ( Facebook: Thai Navy SEAL )

After the first difficult dive into chamber eight there was a long, dry section. That is where Dr Challen was stationed for most of the rescue operation.

A hand-drawn map shows the location of divers using sticky notes, with the Australians in yellow. ( Supplied: Craig Challen )

"That's about 200 metres or so over some sand hills and a rock pile. I was at that stage de-kitting them after the first small dive, transporting them across that, getting their full face masks and all their dive gear back on again and getting them sent off with the divers," he said.

"This is a very critical point because it's so easy just to overlook any small thing when you've torn all the gear apart, put it all back together again. The tiniest little leak would mean that by the time you got back here, they're all full of water."

At chamber three, the US team took the boys from the divers and with Thai personnel rushed them to the field hospital on-site. After initial assessment and treatment they were transferred to Chang Rai hospital by helicopter.

The US Dive Operations Commander, Master Sergeant Derek Anderson, said the realisation at the end of the third day that the operation had been a success was extraordinary.

"There was a moment that night when the last group of people came out, and everybody was all standing there, and we actually took a moment and let the emotions come back in, and I think that it really hit, kind of hit you in the feels, and we were like, 'Man, we just accomplished something as a huge team'," he said.

Sorry, this video has expired Richard Harris (right), pictured with his dive partner Craig Challen, was among the last people out of the cave.

'I've never done anything as risky as that'

US Mission Commander, Air Force Major Charles Hodges, paid tribute to all the Thai and international rescuers involved in the operation. He had special praise for Dr Harris.

"I'm not sure I've ever seen anyone that was so willing to risk professional reputation and his life just based off a phone call from other people, but he absolutely stepped up to the plate," he said.

"He was the one that was in the cave the longest with the children because he would go in first, and he would medically assess them every day, and then he didn't come out until the end."

Dr Challen said the result was beyond their wildest expectations.

"I'm still pinching myself a little bit, wondering if that's really what happened. It does seem too good to be true," he said.

British diver Mr Mallinson said getting all 13 people out of the cave alive was one of his proudest achievements.

"It's one of the most difficult and dangerous and risky things I've ever done, not in terms of my own personal safety, but in terms of the people I was responsible for," he said.

"I've never done anything as risky as that and I don't think I ever will again. But it was the only option we had, and we took it."

The Wild Boars and their coach are set to be discharged from hospital later this week. ( AP: Chiang Rai Prachanukroh Hospital )

Watch Four Corners' full report, Out Of The Dark, tonight at 8.30pm on ABC TV and ABC iView.