The warning came following a meeting between US Commerce Secretary Wilbur Ross and Chinese Vice Premier Liu He in Beijing.
Last week the White House announced it would impose curbs on Chinese investment and purchases of USA high-tech goods and on visas for Chinese students.
Xinhua said China's attitude had been consistent and that it was willing to increase imports from all countries, including the United States.
"The meetings focused on reducing the United States' trade deficit by facilitating the supply of agricultural and energy products to meet China's growing consumption needs, which will help support growth and employment in the United States", it said.
"Reform and opening-up as well as expanding domestic demand are China's national strategies".
"Global trade is not a 'gunfight at the OK Corral, '" he said.More news: Trevor Noah Goes After Jim Acosta for Trump-Kardashian Meeting Criticism
"Agreements between China and the United States should be based on the premise of both sides moving in the same direction and not waging a trade war", the Chinese statement said.
"If the USA launches trade sanction measures, including the imposition of tariffs, then all the economic and trade benefits negotiated by both sides are not going to take effect".
"Our meetings so far have been friendly and frank, and covered some useful topics about specific export items", Ross said.
On Saturday, Mattis said the Trump administration's recent decision to disinvite China from an upcoming naval exercise was an "initial response" to Beijing's aggressive activities. Trump officials are considering levies on $50 billion worth of Chinese imports, as well as new restrictions on Chinese investment in the USA and tighter export controls.
Ross, who was preceded in Beijing this week by more than 50 US officials, was expected during the two-day visit to try to secure long-term purchases of USA farm and energy commodities to help shrink a $375 billion trade deficit with China.
Mr Ross was accompanied by agriculture, treasury and trade officials for the meeting at the Diaoyutai State Guesthouse, a leafy compound on Beijing's west side.More news: Russian Football Club Suggests Cristiano Ronaldo Join Team
While both the U.S. and China reported some progress in discussions this weekend about how to reduce China's $375 billion goods-trade surplus with the U.S., Trump's revival last week of a plan to slap tariffs on $50 billion of Chinese imports has cast the talks into turmoil.
On Friday, the United States' closest allies attacked the Trump administration over the tariffs, with Japan calling the US action "deeply deplorable" during a meeting of G7 finance leaders in Canada.
The statement gave few details on the talks, but it made clear that China would not deliver on commitments to buy more American goods if its exports are sanctioned.
But Mr. Trump upended the truce last Tuesday by renewing his threat to impose 25 percent tariffs on $50 billion in Chinese high-tech goods.
Ross did not speak to reporters in the lobby of his Beijing hotel on Saturday afternoon.
"But I also fundamentally believe that if there are structural changes that allow our companies to compete fairly, by definition, that will deal with the trade deficit alone". Liu's delegation included People's Bank of China Governor Yi Gang (易綱) and the minister of commerce. "The U.S. has been ripped off by other countries for years on Trade, time to get smart!" Germany is also hoping its steel exports to the U.S. will be exempted from sanctions.More news: CAPTURED: Alleged Tennessee cop killer arrested after manhunt, police say