Under the new bill, telecom operators and internet service providers are required to provide technical support and assistance, including decryption, to police and national security authorities in prevention and investigation of terrorist activities.
They should also prevent dissemination of information on terrorism and extremism.
Li Shouwei of the National People's Congress (NPC) Standing Committee legislative affairs commission, said the rule accorded with the actual work needed to fight terrorism and was basically the same as other major countries.
"The clause reflects lessons China has learned from other countries and is a result of wide solicitation of public opinion," he added.
"(It) will not affect companies' normal business nor install backdoors to infringe intellectual property rights, or ... citizens freedom of speech on the internet and their religious freedom," Li said.
China's national security law adopted in July also requires Internet and information technology, infrastructure, information systems and data in key sectors to be "secure and controllable".
Before Sunday's new bill, China did not have an anti-terrorism legislation, though related provisions feature in various NPC Standing Committee decisions, as well as the Criminal Law, Criminal Procedure Law and Emergency Response Law.
The NPC's standing committee passed a decision to improve anti-terrorism work in October 2011, but it was never made into law.
The lack of a systematic law in this field had hampered China's fight against terrorism, with measures deemed not forceful enough, analysts say.
In one of most deadly cases, twenty-nine people were killed and scores more injured by knife-wielding assailants at a train station in Yunnan's capital city, Kunming, on March 1, 2014.
Terrorist attacks have brought greater urgency for a counter-terrorism law. The first draft of the law was submitted for review in October 2014 and the second draft in February.
In a separate clause, Sunday's new bill allows police forces, when facing violent attackers with guns or knives, use weapons directly in emergency circumstances.
In the rare reality of a terrorist attack, no institutions or individuals shall fabricate and disseminate information on forged terrorist incidents, report on or disseminate details of terrorist activities that might lead to imitation, nor publish scenes of cruelty and inhumanity in terrorist activities, the new law reads.
None, except news media with approval from counter-terrorism authorities in charge of information distribution, shall report on or disseminate the personal details of on-scene counter-terrorist workers, hostages or authorities' response activities.
The clause was specifically revised to restrict the distribution of terrorism-related information by individual users on social media, earlier reports said.