Eleven of them, all men, escaped overland to neighbouring Malaysia, where they were caught and charged with illegal entry.
"Prosecutors decided to drop all charges on humanitarian grounds," he said.
The decision was made after lawyers wrote to the Malaysian attorney general urging that the charges be withdrawn, Fahmi added.
Human Rights Watch (HRW) welcomed the group's release.
Since coming to power in May, Mahathir has cancelled more than USD 20 billion worth of mega-infrastructure projects backed by Chinese firms, including rail and gas pipelines.
Uighurs are persecuted in western China, where they are subject to strict regulations suppressing public displays of religion.
Over a million Uighur and other Muslim minority people have been detained in re-education camps for offences as minor as making contact with family members outside the country or sharing Islamic holiday greetings on social media, the UN says.
Beijing has denied reports of the camps but evidence is mounting in the form of government documents and testimonies from former detainees.
A scathing US congressional report released this month accused China of the unprecedented repression of its ethnic minorities, including Uighurs, with authoritarian tactics potentially constituting "crimes against humanity".
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)