China adopted its first counter-terrorism law Sunday after early drafts of the bill attracted strong criticism for provisions that may tighten media controls and threaten the intellectual property of foreign firms.
The legislation comes as Beijing wages a hard-hitting campaign to stamp out ethnic violence in its Xinjiang region and tries to tighten control over political dissent online and on the ground.
It is the "latest attempt to address terrorism at home and help maintain world security", said the official Xinhua news agency.
Details of the bill, which was approved by the standing committee of the rubber-stamp legislature the National People's Congress, were not immediately available.
Xinjiang, home to the mostly Muslim Uighur ethnic minority group, has been plagued by unrest in recent years, prompting China to launch a police crackdown on separatist "terrorists" it says are behind the violence.
In an attempt to control online communications which the government says have contributed to the violence, drafts of the new law have included provisions which could require tech firms to install "back doors" in products or turn over encryption keys to Beijing.
Both are seen as potential threats to freedom of expression and to intellectual property.
The United States has repeatedly expressed concern about the requirements, with President Barack Obama saying he raised the issue with President Xi Jinping during his September trip to Washington.
Chinese foreign ministry spokesman Hong Lei said last week the new law would "not have any restriction on the lawful activities of enterprises. It will not leave back doors, and it will not impede freedom of expression online or the intellectual property rights of enterprises".
The bill comes as Beijing silences critics of its Xinjiang policies, especially those who say violence by Uighurs is a reaction to government discrimination and controls over their culture and religion.
Last week a court imposed a three-year suspended prison sentence on civil rights lawyer Pu Zhiqiang, partly for posts on his social media account that "incited ethnic hatred" between Uighurs and the Han majority ethnic group.
One of these suggested that the government was partly to blame for rising inter-ethnic violence.
Days later Beijing declined to renew the visa of French journalist Ursula Gauthier after she refused to apologise for writing an article that expressed similar sentiments.