The Australian doctor who was the last person to leave the cave in Thailand after the rescue of 12 boys and their football coach emerged from the darkness only to discover his own father had died while he was underground.

Dr Richard "Harry" Harris, an anesthetist as well as an experienced cave diver, played a key role in the successful international rescue effort that ended in joy and relief on Tuesday.

However, the 53-year-old hero found out shortly after leaving the flooded tunnels that his father had passed away while he was carrying out the rescue operation.

South Australian Ambulance said in a short statement that the doctor had suffered a "tumultuous week with highs and lows".

"It is with great sadness that I confirm that Harry’s dad passed away last night a short time after the successful rescue operation in Thailand," Dr Andrew Pearce, MedSTAR's director of clinical services, said.