U.S. Internet giant Google's threat to withdraw from China is generating an outpouring of nationalist fervor from the country's online community, with some cheering it as a victory for the Chinese.

Google, the world's top search engine, said on Tuesday it would not abide by censorship and may shut its Chinese-language google.cn website because of a massive cyber-attack that also targeted at least 20 other companies.

It also said human rights activists using its Gmail service had also been targeted.

The threat has sparked fierce debate on bulletin boards and blogs, a popular source for discussion for China's millions of Internet-savvy youth.

Many viewed the dispute in heavily nationalistic terms, but there was some wistful regret.

If you are in China, you have to do everything in accordance with Chinese culture and act within the law, wrote Yinlitansuoti on the website of widely-read Chinese language tabloid the Global Times (www.huanqiu.com).

Of course it won't pass muster if you contravene our systems!

Google, put your money where your mouth is and get the hell out of China, added boycarcol. What right does a small company have to make demands of the Chinese government? If you don't get the hell out, the people will disdain you even more.

It just wants to blackmail China, commented Jiangly000 on portal www.sina.com.

Do not take yourself so seriously. China can still function without you Google, added another.

Google has failed to infiltrate its values into the Chinese people, a third wrote.

At an Internet cafe near the prestigious Peking University, web designer Cui Junjie, 21, said that for all the bluster, he did not think Google would actually pull out of China.

I think they will lose a lot of money if they do, he said.

Yet the disdain was far from unanimous. Some were not so sure that Google leaving China would be a good thing, wondering whether the fallout would be good for rival home-grown search engine Baidu.

I hope it stays, for the sake of fair competition, wrote Zen Fox. I'm thinking of people who use the Internet. More choice is also a way to encourage Baidu.

Web user Small Bird wrote on the popular web portal www.163.com that the Google debacle was a sad, but not wholly unpredictable, day for China.

It's hard for someone who speaks the truth to survive in China.

Blogger Qinjian said the Google case was just another involving a long list of sites which have run into problems in China, or been blocked totally.

The sin of Facebook is it makes you touch the people you want to touch. The sin of Twitter is it makes you say what you want to say. The sin of Google is it makes you know what you want to know. The sin of YouTube is it proves the truth you want to prove. So they have all been killed.

(Additional reporting by Liu Zhen and Huang Yan)