Malaysia has freed 11 ethnic Uighurs detained last year after they broke out of prison in Thailand and crossed the border, despite a request from Beijing for the men to be returned to China.
Prosecutors dropped immigration charges against the group on humanitarian grounds and they flew out of Kuala Lumpur to Turkey on Tuesday, according to their lawyer Fahmi Moin.
"The charges were withdrawn because the attorney general's chambers agreed to the [appeal] from our side," Fahmi told Reuters news agency.
The decision may further strain ties with China, which has been accused of cracking down on the minority Uighurs in the western region of Xinjiang. Since returning as prime minister following a stunning election victory in May, Mahathir Mohamad has already cancelled projects worth more than US$20bn that had been awarded to Chinese companies.
Malaysia's immigration department, home ministry and attorney general's office did not immediately respond to requests for comment. Neither did China's foreign ministry.
The men arrived in Malaysia after breaking out of prison in Thailand by punching holes in a wall and using blankets as ladders. In February, Reuters reported that Malaysia was under great pressure from China to deport the Uighurs there.
Some Western countries urged the country not to send them to China, where the government in Beijing accuses Uighur separatists of plotting attacks on China's Han majority in Xinjiang and elsewhere.
China has been accused of rights abuses in the far western region, torturing Uighur detainees, and clamping down on their religion - Uighurs are Muslim - and culture. Beijing denies the accusations.
The UN has said about one million Muslims in the Xinjiang region have been rounded up and held in so-called "re-education" centres - camps the Uighurs claim are intended to replace the next generation's Uighur identity with a Chinese one.
The Uighurs in Malaysia were part of a group of more than 200 detained in Thailand in 2014. More than 100 were forcibly returned to China in July 2015, sparking international condemnation.
Malaysia detained the men under the government of former Prime Minister Najib Razak who moved closer to China as he battled a multibillion-dollar corruption scandal.
Mahathir has sought to take a more measured approach to China since his coalition came to power in May, and shown greater willingness to speak in favour of Muslim communities, including the Rohingya in Myanmar.