Image copyright AFP/Getty Image caption The boys ended their retreat as novice Buddhist monks following a prayer ceremony on 4 August

Most of the Thai boys rescued from a flooded cave have returned home after spending time in a Buddhist monastery as novice monks.

Eleven of the Wild Boars youth football team were ordained novices in memory of a diver who died during their rescue.

Their 25-year-old coach, who has received monk's orders, will stay on for three months. One of the boys did not participate as he is a Christian.

The group were trapped for more than two weeks before a dramatic rescue.

Media playback is unsupported on your device Media caption Buddhist monks cut the Thai cave boys' hair

The novice monks - aged between 11 and 17 - left a temple in northern Thailand's Mae Sai district after spending nine days living in a monastery, a tradition for males in Thailand who experience adversity.

The experience was seen as a "spiritual cleansing" for the group, and to fulfil a promise by the families to remember ex-Navy Seal diver, Saman Gunan, who died during the rescue operation.

Image copyright AFP/Getty Image caption The boys were ordained novice monks in honour of the ex-Thai Navy diver Saman Gunan (in portrait)

The length of time spent meditating, praying and cleaning their temple - nine days - is a nod to a Thai lucky number.

Before meeting their families and friends, the boys received a Buddhist blessing from monks as they asked in unison to leave the temple, each saying: "I am now a layman."

The extraordinary story of the group's escape from the snaking caverns of the Tham Luang caves of northern Thailand was not just followed in Buddhist-majority Thailand but by millions around the world.

The 12 boys and their coach had walked into the caves to explore following a football practice on 23 June - only to be trapped by sudden monsoon floods.

Image copyright AFP/Getty Image caption Wild Boars coach Ekkapol Chantawong (l) will remain a monk until the end of Buddhist Lent

They were discovered nine days later by two British divers, having survived on rain water dripping down the cave rocks and meditation led by their coach - already a novice monk - in an attempt to remain calm and use less oxygen.

With more rain expected, a risky rescue was attempted. Over three days, expert divers carried the sedated boys and their coach through darkness and submerged passageways towards the exit.

Media playback is unsupported on your device Media caption The artwork features those who helped to rescue the trapped schoolboys

They were all released from hospital a week before being ordained, and were said to be in good health.

Officials have told media to give time and privacy to the Wild Boars as they adjust back to their normal lives.