“We need to be prepared for the trade war to last a long time,” Mr. Wang added.

Beijing has also tried to show restraint. The prospect that neither side would back down spooked investors at the start of the week. But financial markets grew calmer as the days passed after Chinese officials played down the likelihood that they would strike back at the United States by quickly devaluing the country’s currency, the renminbi.

China’s central bank did, for the second time this week, allow the value of the renminbi to cross a psychologically important point on Thursday, but the move was not as significant as some analysts had expected, and the currency’s value stabilized during the Asian trading day.

Officials in Beijing will “continue to maintain the continuity and stability of the foreign exchange management policy,” Wang Chunying, an economist and a spokeswoman for the State Administration of Foreign Exchange, told the Chinese state news agency Xinhua for an article published on Thursday.

She added that the Chinese government continued to “welcome global investors including the United States to invest in the allocation of renminbi assets.”

Investors’ concerns also eased after China reported trade data on Thursday that suggested its efforts to find customers in countries other than the United States was making progress. Overall exports grew unexpectedly in July from a year earlier, even as shipments to the United States continued to shrink. The challenge for China is whether it can sustain the growth.