Wang Xiujun, the deputy director of the China National Internet Information Office, said political security is fundamental, reported The People's Daily, the official newspaper of the ruling Chinese Communist Party.
Wang's remarks coincide with a broad crackdown on online freedom of expression that has intensified since President Xi Jinping came to power last year. The crackdown has drawn criticism from rights advocates at home and abroad.
"Now, overseas hostile forces are using the Internet as a main channel to penetrate and destroy (us)," Wang was quoted as saying. "Using the name of 'Internet freedom' to repeatedly attack, slander and spread rumors in an effort to undermine our country's stability and national security."
Winning "the struggle for ideological penetration" would "decide to a great extent the future of our party and country", Wang said.
In February, Xi took the reins of a government body for Internet security, saying he aimed to turn China into a "cyber power". He said then that working on public opinion online was a long-term responsibility and the Internet could be used to "spread discipline".
The party renewed a campaign on online discourse last year, threatening legal action against people whose perceived rumors on microblogs are reposted more than 500 times or seen by more than 5,000 people.
China maintains tight control over the media. Censorship is widespread and Internet users cannot access information about many topics without special software to circumvent restrictions.
Wang said China wants to strengthen its security of networks and information systems in part due to intrusions in cyberspace by foreign governments, according to the People's Daily.
The case of former U.S. intelligence contractor Edward Snowden showed that "a few countries have used their superiority in Internet resources and information technology to conduct large-scale Internet surveillance and to steal a large volume of political, economic, military and corporate secrets", Wang said.
He did not name any country but questions over cyber-espionage have long cast a shadow over China-U.S. ties, with each side accusing the other of spying.
The Defense Ministry said in March China would beef up its internet security after the New York Times and Der Spiegel reported that documents leaked by Snowden said the U.S. National Security Agency accessed servers at China's Huawei Technologies to obtain sensitive data and monitor executives' communications.
(Reporting by Sui-Lee Wee; Editing by Paul Tait)