WASHINGTON Even as the United States accuses China of military espionage and worries about Beijing's more strident posture in the Asia-Pacific region, the ties between the armed forces of the two nations have been getting closer.
Direct contact between China's People's Liberation Army (PLA) and some of its potential adversaries has increased dramatically in the last two years.
The first major public sign of the thaw was a joint concert by the U.S. Army band and its Chinese counterpart in 2011 at Washington's Kennedy Center where a female U.S. sergeant and a well-known male Chinese singer in a PLA uniform belted out a duet in Italian from the opera La Traviata.
On a more serious note, China hosted U.S. officers in the city of Nanjing this month to discuss countering pirates, and the United States has invited China to attend the Rim of the Pacific major naval exercises next year.
The increased contact aims to lessen the risk of accidental conflict between nuclear powers as their militaries each learn how the other works and cooperate on uncontroversial issues like disaster prevention and disease control.
The amiable spirit in these areas does not mean China and the United States are any less wary of each other on thorny subjects like allegations of Chinese cyber-spying, the possibility of an arms race in space, and the U.S. military's "pivot" to Asia with a build-up of its forces in the Pacific.
Some discussions have been remarkably blunt - with Chinese officials sometimes telling U.S. counterparts that Washington should quit the entire western Pacific and cede influence there to Beijing
Still, U.S. Air Force Major General Michael Keltz has seen a big change. When he first met with senior Chinese officials in late 2011, the atmosphere was stilted at best. Keltz says they stuck firmly to their prearranged "talking points", sometimes literally reading from pieces of paper.
"There has been a considerable improvement in both volume and quantity (of meetings and exchanges)," says Keltz, head of policy and planning for the U.S. Pacific Command - a role that includes explaining U.S. military thinking to Chinese officials.
Now, Chinese officers are less likely to stall routine conversations with their American opposite numbers by berating them for what they see as anti-China policies such as U.S. support for Taiwan.
After decades of relative isolation, greater military engagement with the outside world is at the heart of Beijing's increasingly assertive military strategy. China's military budget has grown by double digits almost every year for the past decade and it now fields its own aircraft carrier and is testing Stealth fighters.
China has become the largest contributor of U.N. peacekeepers of any of the permanent five Security Council members.
"The Chinese army is now getting much more involved globally," PLA Major-General Chao Liu, China's former defense attaché to India and now commander of U.N. peacekeepers in Cyprus, told Reuters earlier this year. "The differences (with the rest of the world) will become less, I think."
For the United States, there are clear advantages to learning more about a possible foe while at the same time drawing China further into the global system.
Increased contact with China's military gives the United States a chance to explain its new strategic focus on Asia which Beijing fears is a containment strategy to check China's economic and military rise.
The U.S. Pacific Command alone has some 40 exchanges with China planned for this year including talks on military medicine - particularly preparedness for a pandemic outbreak of a disease - and planning for joint maritime search and rescue operations.
And it goes beyond the U.S. to its Western allies. Australia has conducted its own joint exercises with China and is discussing more. European states are stepping up their own links and visits and NATO is considering much closer liaison, perhaps over areas such as peacekeeping in Africa.
While some Western officials complain that Chinese warships operating alongside international forces in anti-piracy patrols off Somalia have spent at least as much time spying on foreign warships as hunting pirates, their presence there is broadly welcomed.
More informal links are increasingly embraced. Retired Western officers in particular are setting up loose networks and visits, sometimes bringing along serving personnel.
Communication is helped by the increasing value the Chinese military puts on Western experience and English language skills. Zhang Zheng, the commander of China's first aircraft carrier, speaks perfect English and studied at Britain's Joint Command and Staff College.
Officers and diplomats say Chinese officials are more willing to share personal email addresses and indulge in private conversations in ways unthinkable only a decade ago.
"We have more tools for contact and cooperation than ever before," says Air Vice Marshal Michael Harwood, British defense attaché to Washington until 2012. "If I was advising a young officer today, I would tell him or her to learn as much about Chinese culture and make as many contacts there as they can."
None of this, though, has diminished military tensions on some major points of disagreement.
U.S. officials say they believe China is preparing a missile test to build its capability to knock down U.S. satellites. And last year, a series of maritime border disputes brought friction between China and U.S. allies such as Japan and the Philippines.
The most persistent bone of contention is cybersecurity.
The Pentagon earlier this month charged China with widespread espionage to acquire technology to fuel its military modernization, accusing Beijing for the first time of trying to break into U.S. defense computer networks. China issued a firm denial.
Espionage is a major concern for the West. Before allowing Chinese personnel access to any facility in the recent exchanges, the United States and others generally conduct a "risk assessment" and security experts will often sweep afterwards for bugs.
Foreign powers are also wary of giving Chinese officers too much access to their training schools and military colleges, complaining Beijing almost never reciprocates by allowing Western nations access to its elite establishments.
While U.S. law specifically prohibits providing China some forms of direct military training, European nations have fewer restrictions and, some officials say, must be careful.
"We don't want to be training China in carrier strike (operations)," said one Western official on condition of anonymity. "I think we can agree on that."
Foreign experts say some elements in the PLA, having pulled out of many of their industrial interests in the last decade, have found stealing and selling intellectual property to be a lucrative earner.
"Stopping it is going to be difficult because it means them stopping something that makes them money," said James Lewis, a former U.S. foreign service officer now a senior fellow at the Center for Strategic and International Studies heavily involved in cyber talks with China.
After years of officially sanctioned discussions on cybersecurity between U.S. and Chinese think tanks, the door to more serious talks may also be quietly opening. For the first time this year, the two countries will officially discuss cybersecurity as part of a wider formal strategic dialogue.
In a shift toward cooperation with China, the top U.S. general in charge of cybersecurity, General Keith Alexander, told the Reuters Cybersecurity Summit in Washington last week that he or his successor would be willing to meet his Chinese counterpart when the time was right.
Sometimes, though, the United States prefers publicly challenging China to quiet diplomacy.
U.S. Chief of Naval Operations Admiral Jonathan Greenert said Washington took a decision to complain more in public this year about hacking by China after crossing what he called "the threshold of frustration".
Since doing so, some current and former officials say the level of Chinese hacking has declined slightly.
Some discussions between the two countries' militaries can be tense, particularly around U.S. "strategic rebalancing" plans such as strengthening military ties to countries like Japan and Australia and eventually increasing to 60 percent the number of its Navy ships devoted to the Pacific.
U.S. Pacific Command's Keltz says Chinese officials told him the Pacific should simply be divided in two, with America dominating one half and China the other.
"That is fundamentally not what the United States is going to do and it's not what most of the other countries in the region want us to do," he said. "I think (Chinese officials) are beginning to understand that."