Several recent attempts to hack into British Government computer networks have been traced to China, Whitehall sources said today.

The attacks are part of a pattern in which China and Russia are switching from "old-fashioned espionage" techniques to electronic hacking into government computers to gain Britain's military secrets, the sources added.

The growing theat from hacking was underlined yesterday when President Bush said he might raise the sensitive issue with Beijing when he meets President Hu Jintao, the Chinese leader, in Sydney tomorrow for an Asia-Pacific Economic Cooperation (Apec) summit.

Asked to respond to allegations that China's People's Liberation Army had hacked into a computer system in the office of Robert Gates, the US Defence Secretary, Mr Bush said: "I'm very aware that a lot of our systems are vulnerable to cyber attack from a variety of places."

He acknowleged he did not have the intelligence "at my fingertips" on the latest hacking allegations, but he said: "In terms of whether or not I'll bring this up to countries ... from which there may have been an attack, I may." He then went on to talk about America's "complex relationship" with China.

The Whitehall sources confirmed that China was one of the countries most involved in electronic espionage against Britain. One source said: "China is engaged in hostile intelligence activities, and instead of using the old-fashioned methods, they are focusing on electronic means to hack into systems to discover Britain's defence and foreign policy secrets, and they are technologically pretty advanced and adept at it."

MI5, which has overall responsibility for safeguarding government secrets and provides protective security advice to Whitehall and to key businesses and public utilities, says on its website that "the intelligence requirements of a number of countries now include new communications technologies, IT, genetics, aviation, lasers, optics, electronics and many other fields. Intelligence services, therefore, are targeting commercial enterprises far more than in the past."

The Security Service adds: "The UK is a high-priority espionage target and a number of countries are actively seeking UK information and material to advance their own military, technological, political and economic programmes."

"We estimate that at least 20 foreign intelligence services are operating to some degree against UK interests. Of greatest concern are the Russians and Chinese," MI5 says.

Specific advice on how to counter the Chinese and Russian hackers is provided by the Centre for the Protection of the National Infrastructure (CPNI) which is answerable to Jonathan Evans, the Director-General of MI5.

All Ministry of Defence and Foreign and Commonwealth Office computers containing sensitive material have advanced firewalls and anti-virus software. But the experts at CPNI have given a warning to Whitehall that the rapid growth of wireless technology has raised the threat posed by hackers. "A key implication of this unprecedented wireless connectivity is that attackers can reach you at all times," the CPNI says on its website.

Beijing this week denied launching cyber attacks against the Pentagon. The Chinese Foreign Ministry said there had been "wild allegations" against China, reflecting a "Cold War mentality".