Thailand has granted citizenship to three young soccer players and their coach who were dramatically rescued with other teammates after spending almost three weeks stuck inside a flooded cave.

During their ordeal, it emerged that the three boys and the 25-year-old coach were among 480,000 stateless people living in the Southeast Asian country.

As a result of their lack of citizenship, they were deprived of some basic benefits and rights, including the ability to venture outside of Chiang Rai, the northern province where they live.

The area is home to ethnic minorities with roots in neighboring Myanmar.

The saga of the Wild Boars club gripped the world after the 12 boys and coach Ekapol Chantawong explored the Tham Luang cave on June 23 and were trapped by rising floodwaters.

An international search dubbed “Mission Impossible” was launched and the group was found by Thai navy SEALs and other experienced divers on July 2.

Wild Boars head coach Nopparat Kanthawong said the four received official Thai ID cards along with another teammate who had not been in the cave but also applied for citizenship.

“I’m happy,” he said. “I want to say that football [soccer] can elevate the lives of kids whose families may not be in the best position.

“If they have Thai citizenship, in the future, if they don’t want to play football, they can take exams to become public officials or find good work that is related to their field of studies,” he said.

Nopparat said he also submitted documentation to help apply for citizenship for seven other players who are stateless.

The boys granted citizenship Wednesday had all applied for it before the cave incident, and all were fully qualified for the change in status, said district chief Somsak Kanakam.

On Thursday, meanwhile, the UN refugee agency welcomed the decision by Thailand to grant citizenship to the three boys and their coach.

“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 adviser 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, according to Reuters.

The dozen 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.

With Post wires