China on Tuesday denied any role in alleged cyberattacks on Indian government offices, calling China itself the biggest victim of hackers.

When asked about Google's allegation that cyberattacks launched from China hit the U.S. search giant, foreign ministry spokesman Ma Zhaoxu said Chinese companies were also often hit by cyberattacks.

"China is the biggest victim of hacking attacks," Ma said, citing the example of top Chinese search engine Baidu.com being hacked last week.

Google last week said it might exit China after being hit by recent hacking attempts largely aimed at accessing the Gmail accounts of Chinese human rights activists. It also said it planned to hold talks with Chinese authorities about whether it could offer an uncensored version of its local search engine.

Ma said he did not know if Chinese authorities had started talks with Google. A Google spokeswoman did not confirm a Bloomberg news report that Google and China had already started the talks. "That's not what we've been saying," she said in an e-mail.

An Indian official has reportedly said local government offices including that of India's National Security Advisor were also targeted last month by hackers believed to be from China.

Ma said the allegation was baseless.