The young soccer teammates and their coach who were rescued after being trapped in a cave in northern Thailand earlier this month have been ordained at a Buddhist temple.

The 11 boys, aged 11 to 16, became Buddhist novices in a religious ceremony – a merit-making activity to show thanks for their rescue.

Their 25-year-old coach was ordained as a monk. One boy did not participate because he isn't Buddhist.

The group prepared for their ordinations on Tuesday with ceremonies that included shaving their heads.

The white clothes they donned then were exchanged the following day for the traditional orange robes. They prayed with guests and local officials attending the ceremony.

The white clothes they donned then were exchanged the following day for the traditional orange robes. They prayed with guests and local officials attending the ceremony.

The ordainment ceremony took place at a mountaintop temple in Chiang Rai province. The group will spend a bit more than a week there.

Buddhist males in Thailand are traditionally expected to enter the monkhood, often as novices, at some point in their lives to show gratitude, often toward their parents for raising them. It's believed that once a person is ordained they gain merit that is also extended to their parents.

In this case the boys were dedicating the act of entering the monkhood to a volunteer diver and former Thai navy SEAL, Saman Gunan, according to Praphun Khomjoi, chief of the regional branch of the National Office of Buddhism.

Mr Gunan died while diving during a mission to supply the cave with oxygen tanks essential to helping the boys' rescue.

"The teachings that we would like to the boys to learn is the awareness of themselves and the importance of their lives," Mr Praphun said.

"It is extraordinary to be born as humans. And as we are given this opportunity, we should use Buddhist principles or principles of any religions as guidance for living.

"That's the lesson that we want them to learn."

Guests included Mr Gunan's family and a doctor who accompanied the team inside cave for nine days while waiting for the divers to bring them out.

The 12 boys and their coach were released from a hospital last week. They became trapped on June 23 and were finally found by two British divers on July 2.