Trump told American trade officials to look into whether Beijing improperly requires foreign companies to hand over technology in exchange for access to Chinese markets.

China’s government criticized U.S. President Donald Trump’s order for a possible investigation into whether Beijing is improperly obtaining foreign technology and said on Tuesday it will “resolutely safeguard” Chinese interests.

A Commerce Ministry statement said Mr. Trump’s order on Monday violates international trade agreements. It said Beijing will take action if Chinese companies are hurt but gave no details of possible responses.

Mr. Trump told American trade officials to look into whether Beijing improperly requires foreign companies to hand over technology in exchange for access to Chinese markets.

Trade groups for technology companies welcomed the action but the Commerce Ministry criticised it as “strong unilateralism” that violates the spirit of international trade agreements.

“If the U.S. side disregards the fact it does not respect multilateral trade rules and takes action to damage the economic and trade relations between the two sides, then the Chinese side will never sit back and will take all appropriate measures to resolutely safeguard the legitimate rights and interests of the Chinese side,” the ministry said in a statement.

Mr. Trump said in April he was setting aside disputes over market access and currency while Washington and Beijing worked together to persuade North Korea to give up its pursuit of nuclear weapons technology. But American officials have resumed criticising Chinese policy in recent weeks.

“We believe the U.S. side should strictly adhere to commitments and should not become the destroyer of multilateral rules,” said the statement.

Ahead of Monday’s announcement, the Chinese foreign ministry appealed to Mr. Trump to avoid a “trade war.”