FILE PHOTO: Rescue workers at the Tham Luang cave complex in Thailand on, July 10, 2018, the day 12 boys were rescued after nine days trapped in the caves. REUTERS/Soe Zeya Tun/File Photo

BANGKOK (Reuters) - The U.N. refugee agency welcomed on Thursday a decision by Thailand to grant Thai citizenship to three boys and their soccer coach from among a group of 13 who were rescued from a flooded cave last month.

The 12 boys and their 25-year-old coach, Ekapol Chanthawong, from the “Wild Boars” soccer team were catapulted into the international spotlight after they became trapped inside the Tham Luang Cave in the northern province of Chiang Rai.

A dramatic, international rescue effort ended on July 10 when they were all brought out safely after an ordeal lasting more than two weeks.

The rescue highlighted the plight of Thailand’s “stateless” people, who are often denied rights and opportunities because they are not citizens. Three of the boys and coach Ekapol were considered stateless, even though they were born in Thailand.

The four were granted citizenship on Wednesday.

“By providing these boys and their coach with citizenship, Thailand has given them the chance to both dream of a brighter future and to reach their full potential,” Carol Batchelor, UNHCR’s Special Advisor on Statelessness, said in a statement.

“By granting them citizenship, Thailand has provided them with a formal identity that will pave the way for them to achieve their aspirations,” she said.

Many of Thailand’s stateless are part of “hill tribes” living in remote border areas where they have limited access to information, including on how to apply for citizenship.

The 12 rescued boys returned to school this week after all but one of them spent nine days in a Buddhist monastery, a tradition for Thai males who experience adversity.