The United States and China have been fighting a series of secret  war games to better understand how each side would respond to a direct internet-based attack, according to a report.

Last year, representatives from the U.S. State Department and the Pentagon took part in two exercises with their Chinese counterparts where they had to describe what they would do if it emerged the other side was behind the release of a sophisticated computer virus damaging to national assets, British daily The Guardian has discovered.

The first meeting took place in Beijing last June, with the second occurring in Washington in December.

A third is planned for May.

According to the paper, the two exercises demonstrated Chinese officials' belief that the U.S. is in decline and is bent on preserving its global status.

China has come to the conclusion that the power relationship has changed, and it has changed in a way that favors them, Jim Lewis, a senior fellow at the Centre for Strategic and International Studies (CSIS), told The Guardian.

The PLA [People's Liberation Army] is very hostile. They see the U.S. as a target. They feel they have justification for their actions. They think the U.S. is in decline, he said.

In the first of the two exercises, each side was asked to imagine what they would do if attacked by a virus such as the infamous Stuxnet, which ravaged computer systems belonging to Iran's nuclear program.

In the second, they were asked to imagine how they would react if they discovered the virus or hacking attack originated from the other side.

According to Lewis, The first one went well, the second one not so well.

The Chinese have a deep distrust of the US, he added.

They are concerned about U.S. military capabilities. They tend to think we have a grand strategy to preserve U.S. hegemony and they see a direct challenge. The [Chinese officials] who favor co-operation are not as strong as the people who favor conflict.

The idea behind the games, which were jointly organized by the CSIS and Chinese think tank the China Institute of Contemporary International Relations, is for intelligence officials to interact in an informal environment, without resorting to official talks.

The games follow recent accusations by the U.S. and European governments that China has engaged in a covert hacking campaign that has stolen billions of dollars' worth of military and industrial secrets from private firms and government agencies.

Both countries have threatened the Chinese with retaliation if the attacks continue.