Swiss President Johann Schneider-Ammann (L) and Chinese President Xi Jinping attend a signing ceremony at Great Hall of the People in Beijing, China, April 8, 2016. REUTERS/Kenzaburo Fukuhara/Pool BEIJING (Reuters) - China's online censorship system protects national security and does not discriminate against foreign companies, the country's internet regulator said, after the United States labeled the blocking of websites by Beijing a trade barrier.

The U.S. Trade Representative (USTR) wrote in an annual report that over the past year China's web censorship has worsened, presenting a significant burden to foreign firms and internet users.

China has long operated the world's most sophisticated online censorship mechanism, widely known outside the country as the Great Firewall, though USTR had not listed it as a trade impediment since 2013, when Xi Jinping became China's president.

The Cyberspace Administration of China (CAC) said that its online censorship did not target specific countries or violate its trade commitments.

"The aim of the internet security inspection system is to guarantee the security and controllability of information technology products and services, safeguard user information security, and strengthen market and user confidence," CAC said in a fax to Reuters late on Friday.

"China scrupulously abides by World Trade Organization principles and its accession protocols, protects foreign enterprises' lawful interests according to law, and creates a fair market environment for them," the regulator said.

Censorship is mainly related to products and services that involve "national security", it said.

Under Xi, the government has implemented an unprecedented tightening of internet controls and sought to codify the policy within the law.

The websites for Google's services, Facebook and Twitter, and many top global news websites are inaccessible in China. Officials say web controls help maintain social stability and security amid threats such as terrorism.

An editorial in the Global Times, an influential state-run tabloid, said history will judge the Great Firewall positively as it will give China time to develop "soft power and strength" in the face of "Western opinion's interference".

"China has achieved this - it can communicate with the outside world, meanwhile, Western opinions cannot easily penetrate as ideological tools," the newspaper said on Monday.

According to data from the anti-censorship group GreatFire.org, almost a quarter of the hundreds of thousands of web pages, domains, encrypted sites, online searches and IP addresses that it monitors in China were blocked as of early April.

That was up from 14 percent at the time Xi assumed the presidency.

Foreign business lobbies complain that Chinese internet restrictions go beyond inconvenience and actually limit business competitiveness.

A 2016 survey by the American Chamber of Commerce in China showed 79 percent of its members reported a negative impact on business due to internet censorship.

(Reporting by Michael Martina; Editing by Simon Cameron-Moore)