BEIJING — China on Tuesday denied a report that its military had hacked into Pentagon computers, saying the allegations were “groundless” and that Beijing was opposed to cybercrime.

The Financial Times, citing unnamed officials, reported Monday that the People’s Liberation Army hacked into a computer system in the office of Defense Secretary Robert Gates in June. The attack forced officials to take down the network for more than a week, the report said.

“Some people make groundless accusations against China” that its military attacked the Pentagon, Chinese Foreign Ministry spokeswoman Jiang Yu said at a news briefing.

“China has all along been opposed to and forbids criminal activities undermining computer networks, including hacking,” she said. “China is ready to strengthen cooperation with other countries, including the U.S., in countering Internet crimes.”

The Financial Times report said the Pentagon was still investigating how much information was stolen but cited an unnamed person as saying that most of it was probably unclassified.

Today, The Guardian newspaper in London also reported that Chinese hackers launched online assaults against the network at Britain’s Parliament and Foreign Office. The Guardian cited anonymous government officials.

The British government, its Ministry of Defense and its Foreign Office declined to comment. China’s embassy could not be reached for comment.

The claims mark the latest incidents in which China was accused of hacking into a foreign government’s computers. On the eve of German Chancellor Angela Merkel’s visit to Beijing last week, the weekly Der Spiegel said computers at the Chancellery and three ministries had been infected with so-called Trojans, or spy programs.

The Financial Times report, which did not specify its sources, said Germany’s domestic intelligence agency believed hackers associated with the People’s Liberation Army might have been behind the alleged hacking.

At the time, Premier Wen Jiabao called the reported hacking a “matter of grave concern” and said China would take “firm and effective action” to prevent such crimes.

The Pentagon warned earlier this year that China’s army is emphasizing hacking as an offensive weapon. It cited Chinese military exercises in 2005 that included hacking “primarily in first strikes against enemy networks.”

The Associated Press reported in July that the State Department was trying to recover from large-scale network break-ins affecting operations worldwide. The hackers appeared to target the department headquarters and offices dealing with China and North Korea, it was reported.

However, experts have said that China is home to a large number of insecure computers and networks that hackers in other countries could use to disguise their locations and launch attacks.