China is digging in for a new battle in its trade war with the United States, declaring Friday that it has no choice but to “take necessary countermeasures” against increased tariffs on its goods.

The declaration was posted on the Chinese Commerce Ministry’s website at 12:03 p.m. Beijing time — exactly two minutes after the United States raised tariffs on $200 billion worth of Chinese goods to 25 percent from 10 percent, as President Trump had threatened. The two sides will meet again Friday morning in Washington, but many economists and other experts see little prospect of a breakthrough any time soon.

 “The level of antagonism and distrust between the U.S. and China, which has culminated in an all-out trade war, makes it difficult to envision a path out of the quagmire the two sides are now in,” said Eswar Prasad, former head of the International Monetary Fund’s China division. 

Chinese stock markets, after suffering big losses earlier in the week, actually gained on Friday. The Shanghai Composite index rose 3.1 percent, and the Shenzhen Component index gained 4 percent. European markets also were generally up, but Wall Street opened lower.

For President Xi Jinping and his ruling Communist Party, the escalation in trade tensions could hardly have come at a worse time. 

He will now have to find a way to forge a deal with the United States that he can sell as a victory at home — at the same time as the party steels itself for June 4, the 30th anniversary of the protests that began in Tiananmen Square and left thousands dead across the country.

 “The weeks ahead of us are very crucial. We have to pass that sensitive date,” said one Chinese observer with close links to decision-makers in the party. “Nothing can go wrong; there can be no bad news,” he said on the condition of anonymity to discuss delicate internal deliberations. 

Nerves are running so high that party organs are constantly being told to “guard against color revolutions,” the observer said, referring to the popular uprisings that toppled leaders in former Soviet states including Georgia and Ukraine. “Everything is related to China’s internal politics,” he said.

In the middle of this tense environment comes the surprise escalation in the trade war — one that Trump has blamed on the Chinese side for seeking to revise key parts of their 150-page agreement at what was supposed to be the 11th hour. 

In all seven chapters of the draft deal, China had deleted its commitments to change laws to address U.S. concerns, Reuters reported. These concerns included the theft of U.S. intellectual property and trade secrets, forced technology transfers, competition policy, access to financial services and currency manipulation.

That prompted Trump on Sunday to publicly threaten on Twitter to raise the tariffs.

“What I’m seeing is a couple blinded by anger, fighting and pouring toxic words on one another: One side is threatening tariff hikes, and the other talks about countermeasures,” said Chen Fengying, a senior researcher at the China National Association for International Studies. “After what Trump has said, it would be unlikely for China to sit back and accept the humiliation,” she said.

Trump’s tweets caused China’s leaders to gather at Zhongnanhai, the Communist Party headquarters in Beijing, on Monday to discuss whether Liu He, the vice president and lead negotiator, should still go to Washington this week. He did, having dinner with his counterparts just hours before the tariffs went up to 25 percent.

Liu would not have made the trip if China did not want to find a way to reach a deal, Chen said.

The two sides were scheduled to resume talks Friday morning, but there was little optimism about them.

“I don’t see a short-term resolution in the making,” said Paul Haenle, a former China director on the National Security Council who now runs the Carnegie-Tsinghua Center in Beijing.

 “It’s now become much more complicated to cut a deal because Trump has put a spotlight on all the things that the Chinese are most reluctant to give up,” he said, citing intellectual property rights and forcing companies that operate in China to hand over their technology secrets.

The higher tariffs apply only to goods that leave China from Friday onward, not to shipments already on their way to the United States. That gives the two sides a couple of weeks to work out a deal before tariffs actually take effect — although that puts the agreement even closer to the June 4 anniversary of the 1989 protests. 

China’s Commerce Ministry said China “deeply regrets” the U.S. decision to increase the tariffs. But it did not go into details about the countermeasures it would impose, triggering speculation that it was not ready.

The prospect of higher tariffs is already concerning some exporters. “Although sales to the U.S. make up only 10 percent of the total, I am worried,” said July Lee, the owner of a factory in Shenzhen that makes LED-illuminated makeup mirrors. “We will still suffer some losses,” she said.

Analysts are now waiting to see if Trump slaps duties on the remaining $325 billion worth of “untaxed” goods that China sends to the United States. That could make the trade war sufficiently painful to China to trigger compromise — or to the United States, where consumers would face higher prices for goods such as electronics.

Some experts are concerned that the trade war will inflict significant direct and collateral damage on both sides, although this may not immediately be apparent, given that the U.S. economy is performing well and the Chinese economy has not slowed down as quickly as expected.

“A deeper concern is that the trade war could morph into broader open economic warfare, affecting all aspects of the economic relationship between the two countries,” said Prasad, who now teaches at Cornell University. “Investment flows, business relationships, and even flows of tourists and students between the two countries could be adversely affected.” 

Lyric Li, Liu Yang and Wang Yuan contributed to this report.