The warning came after U.S.-Chinese delegations wrapped up their latest round of talks as part of a sprawling trade dispute between Beijing and Washington.
It also came just days after the Trump administration announced new tariffs on steel and aluminium from Canada, Mexico and the European Union, prompting outrage from America's closest allies and major trading partners.
China released a statement early on Sunday warning that any achievements made during the talks should be "based on the premise" of not fighting a "trade war."
"If the United States introduces trade sanctions including tariffs, all the economic and trade achievements negotiated by the two parties will be void," said the statement, which was carried by the official Xinhua News Agency.
There was no immediate comment or statement from the U.S. delegation, which was led by Commerce Secretary Wilbur Ross.
Ross had previously said the two parties had discussed which specific U.S. exports China might purchase. But the negotiations ended with no joint statement and neither side released further details.
Let our news meet your inbox. The news and stories that matters, delivered weekday mornings.
Ross is expected to leave Beijing later on Sunday.
Trump has been pressing Beijing to narrow its politically volatile trade surplus with the U.S., which reached a record $375.2 billion last year.
But the White House threw the status of the talks into doubt this week by renewing a threat to impose 25 percent tariffs on $50 billion of Chinese high-tech goods in response to complaints Beijing steals or pressures foreign companies to hand over technology. The event went ahead despite that but Beijing said it reserved its right to retaliate.
The new Chinese threats came as the U.S. was singled out by some of its closest allies, who warned Trump's new levies on steel and aluminium imports will undermine open trade and weaken confidence in the global economy.
"The idea that the Canadian steel that's in military, military vehicles in the United States, the Canadian aluminum that makes your, your fighter jets is somehow now a threat?" Trudeau said in an exclusive interview with "Meet the Press" moderator Chuck Todd, which took place in Trudeau's office in Parliament in the Canadian capital of Ottawa. "The idea that we are somehow a national security threat to the United States is quite frankly insulting and unacceptable."
G7 finance ministers expressed their collective "concern and disappointment," urging the U.S. to abandon the tariffs ahead of the leaders' summit next week in Quebec.
"The international community is faced with significant economic and security issues, which are best addressed through a united front from G7 countries," ministers said in a joint summary issued Saturday by Canadian Finance Minister Bill Morneau, following a three-day meeting in Whistler, Canada.
Bruno Le Maire, France's finance and economy minister, was blunt in his assessment of the meeting, where ministers confronted Treasury Secretary Steven Mnuchin.
"It has been a tense and tough G7 — I would say it's been far more a G6 plus one than a G7," said Le Maire, who called the tariffs unjustified.
Before the White House's threats this week, Chinese-U.S. trade tensions had appeared to ease after China promised on May 19 to "significantly increase" purchases of farm goods, energy and other products and services following the last round of talks in Washington.
Mattis, who was speaking at an international security forum in Singapore and who is due to visit Beijing this month, said: "China's policy in the South China Sea stands in stark contrast to the openness that our strategy promotes, it calls into question China's broader goals."
He Lei, the head of the Chinese delegation to the dialogue, said the islands were Chinese territory and it was "a sovereign and legal right for China to place our army and military weapons there."