A Thai criminal court ruled on Friday that the prolonged detention of 17 suspected Uighur was legal, but did not specify which country - Turkey or China - they should be sent back to.
Their lawyer immediately filed an appeal.
Danthong Breen, an advisor to the Union for Civil Liberty local human rights group who attended the hearing, told The Anadolu Agency, "the judges said that the immigration department did nothing wrong by detaining them, but added that it was up to the Thai government to decide which country to send them to."
The suspected Uighurs - four adults and 13 children, all belonging to the same family - have become the subject of a tug-of-war between China and Turkey, both of which claim the 17 as their nationals.
While China has identified the group as being from its Xinjiang Uyghur Autonomous Region, the family and their lawyer told the court on Tuesday they had been granted Turkish passports by its embassy in the Thai capital while in detention.
The group was arrested by Thai police in March last year while crossing the Thai-Cambodian border and have since been detained at a Bangkok immigration detention center, where two of the children were born. Under Thai law, court approval must be obtained for detention periods of more than seven days.
The husband and wife, Ashan Teklimakan and Rukiye Teklimakan, told judges at a hearing on Tuesday that the whole family - which includes the husband's two sisters and their children - were Turkish citizens and wanted to go to Turkey.
Breen referred to the Friday ruling as "an awful decision".
"Given that the fastest appeal processes are taking two to three years, these children could spend years in jail. But at least, the judges did not decide to send them back to China."
The Turkish Embassy's First Counsellor Ahmet Idem Akay told AA Tuesday that they were following the case since the family members were now "Turkish citizens."
Several representatives from the Chinese embassy had also attended Tuesday's hearing, while a police immigration officer giving testimony confirmed Beijing has asked Thailand to repatriate them.
The Bangkok Post reported earlier this month that China has asked Thailand to provide fingerprints and photos of all those detained so that they can check if "they are terrorists."
Since October 2013, around 300 Uighur have been rounded up in Thailand. Many of them claim to have Turkish nationality and are currently in detention in Bangkok or in Songkhla, in the country's south.
On several previous occasions, Turkish passports held by Uighur have been shown to be fake and bought on the black market, and the holders eventually returned to China.
In September 2014, four Uighur were arrested in Indonesia for violating immigration law by using fake Turkish passports.
Many others from the Muslim ethnic group have been rounded up in Malaysia and charged with the same crime.
The Uighur - who constitute around 45 percent of the population of Xinjiang, home to the Uighur - have accused China of carrying out repressive policies that restrain their religious, commercial and cultural activities.
A yearlong "anti-terrorism" campaign - focusing on Xinjiang-- was launched by China's central government on May 23 and will be in effect until June 2015.