The new regulations, announced by the official Xinhua news agency, also require Internet users to register with their real names when signing up with network providers, though, in reality, this already happens.
Chinese authorities and Internet companies such as Sina Corp have long since closely monitored and censored what people say online, but the government has now put measures such as deleting posts into law.
"Service providers are required to instantly stop the transmission of illegal information once it is spotted and take relevant measures, including removing the information and saving records, before reporting to supervisory authorities," the rules state.
The restrictions follow a series of corruption scandals amongst lower-level officials exposed by Internet users, something the government has said it is trying to encourage.
Li Fei, deputy head of parliament's legislative affairs committee, said the new rules did not mean people needed to worry about being unable to report corruption online. But he added a warning too.
"When people exercise their rights, including the right to use the Internet, they must do so in accordance with the law and constitution, and not harm the legal rights of the state, society ... or other citizens," he told a news conference.
Chinese Internet users already cope with extensive censorship measures, especially over politically sensitive topics like human rights and elite politics, and popular foreign sites Facebook, Twitter and Google-owned YouTube are blocked.
Earlier this year, the government began forcing users of Sina's wildly successful Weibo microblogging platform to register their real names.
The new rules were quickly condemned by some Weibo users.
"So now they are getting Weibo to help in keeping records and reporting it to authorities. Is this the freedom of expression we are promised in the constitution?" complained one user.
"We should resolutely oppose such a covert means to interfere with Internet freedom," wrote another.
The government says tighter monitoring of the Internet is needed to prevent people making malicious and anonymous accusations online, disseminating pornography and spreading panic with unfounded rumors, pointing out that many other countries already have such rules.
Despite periodic calls for political reform, the party has shown no sign of loosening its grip on power and brooks no dissent to its authority.