When the 12 Thai boys who were trapped in a cave and were rescued one by one were first discovered by British divers earlier this month, they were reportedly meditating.

“Look at how calm they were sitting there waiting. No one was crying or anything. It was astonishing,” the mother of one of the boys told the AP, referring to a widely shared video of the moment the boys were found.

Turns out that their coach, Ekapol Chanthawong, who led them on a hike into the cave when it flooded on June 23, trained in meditation as a Buddhist monk for a decade before becoming a soccer coach.

According to multiple news sources, he taught the boys, ages 11 to 16, to meditate in the cave to keep them calm and preserve their energy through their two-week ordeal.

“He could meditate up to an hour,” Ekapol’s aunt, Tham Chanthawong, told the AP. “It has definitely helped him and probably helps the boys to stay calm.”

Ekapol, 25, went to live in a monastery at age 12 after he was orphaned. According the Straits Times, he trained to be a monk for 10 years at a monastery in Mae Sai, Thailand, but left to care for a sick grandmother. He then was hired to be the assistant coach of the team, known as the Wild Boars.

Coach Ake, as he is known, still maintains close contacts at the Wat Phra That Doi Wao monastery in Chiang Rai province. The abbot there told the Wall Street Journal he’s “a responsible young man who meditates regularly.”

Update, July 25: The Guardian reports that the 11 out of 12 of the boys would be staying in the Wat Phra That Doi Wao temple for nine days as part of a novice Buddhist monk ordination process to offer gratitude after the rescue.

That meditation would be a useful practice in an extremely stressful situation like being trapped in a cave is really no surprise. Buddhist meditation has been around for 2,600 years, since the Buddha began teaching it as tool for achieving clarity and peace of mind, and ultimately, liberation from suffering.

Recently, scientific researchers have shown in clinical settings that mindfulness meditation (a specific meditation practice and one that’s taught in Thai Buddhism and elsewhere around the world) can reduce anxiety and depression, as well as pain.

Though there are few randomized control trials on meditation and mental health, a 2014 meta analysis by Johns Hopkins researchers for the Agency for Healthcare Research and Quality found that meditation, and in particular mindfulness, can have a role in treating depression, anxiety, and pain in adults — as much as medications but with no side effects. Meditation can also, to a lesser degree, reduce the toll of psychological distress, the review found. The research on kids is still fairly preliminary, though more and more schools are implementing mindfulness meditation programs.

Related Why Buddhism is true

As Brother Phap Dung, a senior disciple of the Zen Buddhist master and author Thich Nhat Hanh, told me in a 2016 interview: In meditation, “you’re cultivating [peace, kindness, clarity] so you can offer it to others. When you sit with someone who’s calm, you can become calm. If you sit with someone who’s agitated and hateful, you can become agitated and hateful.”

In a cartoon that’s been circulating in Thailand, an artist shows Ekapol with a lap full of tiny boars, peacefully meditating.

Though he has managed to keep the boys safe and calm, Ekapol apologized to their parents in a letter delivered by the Royal Thai Navy on Saturday. “To the parents of all the kids, right now the kids are all fine, the crew are taking good care. I promise I will care for the kids as best as possible. I want to say thanks for all the support and I want to apologize,” Ekapol wrote, according to ABC News.