Google, the world's leading search engine, has thrown down the gauntlet to China by saying it is no longer willing to censor search results on its Chinese service.

The internet giant said the decision followed a cyber attack it believes was aimed at gathering information on Chinese human rights activists.

The move follows a clampdown on the internet in China over the last year, which has seen sites and social networking services hosted overseas blocked – including Twitter, Facebook and YouTube – and the closure of many sites at home. Chinese authorities ­criticised Google for supplying "vulgar" content in results.

Google acknowledged that the decision "may well mean" the closure of Google.cn and its offices in China.

That is an understatement, given that it had to agree to censor sensitive material – such as details of human rights groups and references to the pro-democracy protests in Tiananmen Square in 1989 – to launch Google.cn.

Google was in contact with the US state department before its announcement. Spokesman PJ Crowley said: "Every nation has an obligation, regardless of the origin of malicious cyber activities, to keep its part of the network secure.

"That includes China. Every nation should criminalise malicious activities on computer networks."

In a post on the official Google Blog, the company outlined a "highly sophisticated and targeted" attack in December which it believes affected at least 20 other firms: "These attacks and the surveillance they have uncovered, combined with the attempts over the past year to further limit free speech on the web, have led us to conclude that we should review the feasibility of our business operations in China.

"We have decided we are no longer willing to continue censoring our results on Google.cn, and so over the next few weeks we will be discussing with the Chinese government the basis on which we could operate an unfiltered search engine within the law, if at all."

Hillary Clinton stepped into the debate, urging Beijing to respond to Google's announcement.

The US secretary of state said in a statement: "We have been briefed by Google on these allegations, which raise very serious concerns and questions. We look to the Chinese government for an explanation."

She added: "The ability to operate with confidence in cyberspace is critical in a modern society and economy."

Human Rights Watch praised the decision and urged other firms to follow suit in challenging censorship. "A transnational attack on privacy is chilling, and Google's response sets a great example," said Arvind Ganesan, director of the group's corporations and human rights programme.

Google said the cyber attack originated from China and that its intellectual property was stolen, but that evidence suggested a primary goal was accessing the Gmail accounts of Chinese human rights activists.

Two accounts were accessed but Google believed only account information and subject lines were obtained. It is notifying the other targeted companies and working with US authorities.

Its investigation had shown that, separately, the accounts of dozens of US-, China- and Europe-based Gmail users who are advocates of human rights in China appeared to have been routinely accessed by third parties.

The company added that it was sharing the information not just because of the security and human rights implications "but because this information goes to the heart of a much bigger global debate about freedom of speech".

Acknowledging the potential consequences, it stressed: "This move was driven by our executives in the United States, without the knowledge or involvement of our employees in China."

The message, headlined "A New Approach to China" and signed by David Drummond, senior vice-president of corporate development and chief legal officer, said the company launched Google.cn in 2006 in the belief that the benefits of increased access to information for people in China "outweighed our discomfort in agreeing to censor some results".

At the time Google promised to monitor conditions in China and reconsider its approach if necessary.

But Evgeny Morozov, an expert on the political effects of the internet and a Yahoo fellow at Georgetown University, questioned why Google had made the decision after four years.

"They knew pretty well what they were getting into. Now it seems they are playing the innocence card ... It's like they thought they were dealing with the government of Switzerland and suddenly realised it was China," he said.

Morozov said it was hard to see the logical connection between the security of human rights activists and Google's self-censorship, particularly given that the firm had chosen not to comment on whom it believed responsible for the hacking. It had become easier for "pretty much anyone" to launch cyber attacks in the last few years, he added.

He added that it could have been damaging for Google if news of the breach had emerged later and it appeared the company had done nothing.

Google has only a third of the search-engine market in China, which is dominated by the Chinese giant Baidu. Although its revenues have continued to rise, many analysts believed it was finding business hard going. In June Google suffered intensive disruption to search functions and Gmail for over an hour, after authorities told it to scale back search functions.

China has the world's largest internet population.

Rebecca MacKinnon, an assistant professor at the University of Hong Kong's Journalism and Media Studies Centre, said her research showed Google had censored less than Baidu. Google's decision "certainly sets an example in terms of a company trying to do what's best for the user and not just whatever increases the profit margins", she added.

Nart Villeneuve, research fellow at the University of Toronto's Citizen Lab – which examines the exercise of political power in cyberspace – said the decision to give such a full account of the attacks and link it to human rights issues was unprecedented.

Google's decision to launch the censored service was highly controversial at the time. It was attacked by campaigners and accused of "sickening collaboration" in a Congressional hearing.

The Chinese Foreign Ministry referred the Guardian to the Ministry of Industry and Information Technology. But an employee at MIIT said it was not responsible for handling the query, because it dealt with only the technical side of internet issues. He added that many other departments dealt with other aspects of internet management, but added that he did not know who the Guardian should contact in this instance.