China has rejected allegations of involvement in a cyber attack that originated from the city of Jinan that selectively targeted key government officials in the U.S. and its allies.

China's statement came a day after search giant Google revealed that it has disrupted a hacking effort that appears to have originated from China, targeting Gmail accounts of various people, including senior U.S. government officials.

Foreign ministry spokesman Hong Lei told reporters that efforts to put all of the blame on China was unacceptable.

“China itself had been a victim of hacking attacks and that the government pays great attention to cyber security. The so-called statement that the Chinese government supports hacking attacks is a total fabrication and has ulterior motives,” he said.

Google said the hackers were trying to monitor the contents of these users' emails, with the perpetrators apparently using stolen passwords to change peoples' forwarding and delegation settings.

The world's largest Internet company said that attacks were the latest computer-based invasions directed at western companies and come a year after Google and numerous companies were targeted by hackers traced to China.

Britain's Guardian has reported that the sophistication of the attacks and their highly targeted nature eliminates direct financial gain as a motive. Google has not ruled out the chances of a state-sponsored hack attack. The report says there is no evidence suggesting that the cyber criminals were in Chinese government payrolls.

However, there have been serious allegations against the Chinese state machinery in the past over cyber attacks on the U.S. and allies. Experts have said in the past that, for China, cyber warfare fits into the scheme of things.

The hack attack came to light just a day after it was revealed that the U.S. government was planning to bring in legislation declaring cyber attacks as acts of war.

The US Department of Defense (DOD) announced on Tuesday that the military is ready to use force in response to cyber threats. The agency’s cyberspace operations will fully commence next month but the country will not step back from using physical means to protect the country from any cyber attack that may prove to be a threat for the country.