Chinese leader Xi Jinping averted a confrontation during his visit to the United States by agreeing with President Barack Obama that each country would refrain from conducting or supporting cyberattacks to steal intellectual property for commercial gain.

China has never admitted to launching cyberattacks, but Obama made it clear that Beijing was responsible by telling Xi in public: "Such actions have got to stop."

The two countries agreed to set up a dialogue on cyber-related issues where representatives will meet twice a year. The Americans will inform their Chinese counterparts of any cyberattacks and the Chinese side will look into each allegation. Very likely, China will accuse Americans of attacks, too.