Beijing has in recent years launched a security crackdown in Xinjiang against what it calls separatist elements, and a United Nations report has cited estimates that up to one million ethnic Uighurs and other Muslim minorities are held in extra-judicial, political re-education camps.
The new law, which was published on Tuesday, stated: "Officials at or above the county level may set up vocational education and training centers, and other re-education institutions and management departments, to carry out the educational transformation of those affected by extremism".
A new clause directs the centres to teach the Mandarin language and provide occupational and legal education, as well as "ideological education, psychological rehabilitation and behaviour correction".
The U.N. got what it called credible reports that Chinese authorities were putting Uighurs into internment and re-education camps for long periods of time without criminal charges. "China relations and seek to chart a new path forward, it is vital that our foreign policy prioritizes the promotion of universal human rights and the protection of basic human dignity, principles the Chinese Communist Party is actively trying to redefine", they said.
This has led US Secretary of State Mike Pompeo and, more recently, US Vice-President Mike Pence to denounce China's treatment of Uighurs.
Authorities in China's predominantly Muslim region of Xinjiang have launched a campaign against halal products in a bid to stop Islam "penetrating secular life" and fuelling "extremism".
"It's a retrospective justification for the mass detainment of Uighurs, Kazakhs, and other Muslim minorities in Xinjiang", said James Leibold, a scholar of Chinese ethnic policies at Melbourne's La Trobe University. Ms Maya Wang, senior researcher at Human Rights Watch, said they served only to add "a veneer of legality" to what the Chinese government was doing in Xinjiang.
In 2017, China banned activity deemed "extremist" was banned, including wearing a headscarf, having "abnormal" beards, refusing to follow state media, or preventing children from receiving state education.
China is also launching a wider campaign against Islamic practices across Xinjiang.
Muslims pray at a mosque during Ramadan in Urumqi, Xinjiang Uighur Autonomous Region, July 6, 2015.
The camps are part of a broader attack on Islamic extremism in Xinjiang.
On Monday 8 October 2018, Communist Party leaders in the regional capital Urumqi led cadres in swearing an oath to fight the "pan-halal trend", AFP reported.
Reports have emerged that inmates are being transferred from their home province into neighbouring Gansu province as well as regions as distant as Heilongjiang, thousands of kilometres away on the opposite side of the country, with speculation China is using the tactic to more closely control the Muslim population as well as control the flow of information about alleged human rights abuses.
China has never officially acknowledged the existence of the camps, but maintains its tough line on Xinjiang is necessary to counter terrorism.