BEIJING (AP) — China on Friday threatened retaliation if U.S. President Donald Trump’s planned tariff hikes go ahead, while the renewed acrimony between the two biggest global economies sent stock markets tumbling.

China’s government accused Trump of violating his June agreement with President Xi Jinping to revive negotiations aimed at ending a costly fight over Beijing’s trade surplus and technology ambitions.

Trump rattled financial markets with Thursday’s surprise announcement of 10% tariffs on $300 billion of Chinese imports, effective Sept. 1. That would extend punitive duties to everything the United States buys from China.

If that goes ahead, “China will have to take necessary countermeasures to resolutely defend its core interests,” said a foreign ministry spokeswoman, Hua Chuying.

“We don’t want to fight, but we aren’t afraid to,” Hua said at a regular news briefing. She called on Washington to “abandon its illusions, correct mistakes, and return to consultations based on equality and mutual respect.”

Washington and Beijing are locked in a battle over complaints China steals or pressures companies to hand over technology. The Trump administration worries American industrial leadership might be threatened by Chinese plans for government-led creation of global competitors in robotics and other technologies. Europe and Japan echo U.S. complaints those plans violate Beijing’s market-opening commitments.

Washington earlier imposed 25% tariffs on $250 billion in Chinese products. Beijing has retaliated by raising import duties on $110 billion of U.S. goods.

Beijing is about to run out of American imports for retaliation due to their lopsided trade balance.

China imported U.S. goods worth about $160 billion last year. But regulators have extended retaliatory measures to include slowing down customs clearance for American companies and putting off issuing license in insurance and other fields.

Beijing also is threatening to release an “unreliable entities” blacklist of foreign companies that might face restrictions on doing business with China. Plans for that were announced after Washington imposed crippling restrictions in May on sales of U.S. technology to Chinese tech giant Huawei Technologies Ltd.

Trump’s announcement surprised investors after the White House said Beijing promised to buy more farm goods. It came as their latest trade talks ended in Shanghai with no sign of a deal. Officials said they would resume next month in Washington.

The announcement “is likely to put a comprehensive deal further out of reach,” said Fitch Solutions in a report.

Tokyo’s main stock market index fell 2.5% by midday and Hong Kong’s benchmark lost 2.3%. Markets in Shanghai, Sydney and Seoul also declined.

Earlier on Wall Street, the benchmark Standard & Poor’s 500 fell for a fourth day, losing 0.9% to 2,953.56.

The Dow Jones Industrial Average declined 1% to 26,583.42. The Nasdaq composite ended 0.8% lower at 8,111.12.

READ MORE: 3 ways Trump disagrees with Fed chair Powell on the economy

Also Friday, China’s yuan fell to its lowest level this year against the dollar after Trump’s tariff threat fueled concerns about slowing economic growth, coming close to breaking the politically sensitive level of seven to the U.S. currency.

The yuan tumbled to 6.9520 to the dollar, its weakest since December, but recovered slightly by midday.

Trump’s threat “will likely put more depreciation pressure” on the currency, said Tao Wang of UBS in a report. She said Beijing is likely to “tightly manage” the exchange rate “to avoid any significant depreciation.”

The currency’s weakness is helping to fuel Washington’s trade complaints. The U.S. Treasury Department declined in May to label China a currency manipulator but said it was closely watching Beijing.

The level of seven yuan to the dollar has no economic significance, but could revive U.S. attention to the exchange rate.

Trump’s earlier tariffs were intended to minimize the impact on ordinary Americans by focusing on industrial goods. But the new tariffs will hit a vast range of consumer products from cellphones to silk scarves.

China’s foreign minister criticized the move.

“Imposing tariffs is definitely not the right way to resolve trade frictions,” Wang Yi told reporters in Bangkok, where he was attending a meeting of the Association of Southeast Asian Nations.

Trump has long said he was preparing to tax the $300 billion in additional Chinese tariffs. But he had suspended the threat after meeting Xi at a gathering of the Group of 20 major economies in Osaka, Japan.

The president accused Beijing of failing to follow through on stopping the sale of fentanyl to the United States or on purchasing large quantities of farm goods such as soybeans. Speaking to reporters Thursday at the White House, Trump complained Xi is “not moving fast enough.”

Talks broke down in May after the United States accused the Chinese of reneging on earlier commitments.