When China joined the World Trade Organization in 2001, the United States and its allies hoped that Beijing would adopt an increasingly liberal approach to its economy and financial markets, more closely mirroring its trading partners in the West. Political liberalization, it was assumed, would inevitably follow.

This week has exposed the faulty logic that underpinned those assumptions. A clash over free expression has ensnared the NBA, and the Trump administration has taken action against Beijing over alleged human rights violations. At stake is the relationship between the world’s two largest economies — as well as a crucial round of trade negotiations.

China demanded Washington lift sanctions on Chinese tech companies and warned Wednesday it will “resolutely safeguard” the country’s interests.

The Ministry of Commerce criticized curbs imposed on sales of U.S. technology to a group of Chinese companies as interference in the country’s affairs. American officials say those companies provide technology used to repress Muslim minorities in the northwestern region of Xinjiang.

‘Recession risk is real:’ Trade war bites deep as manufacturing drops to 10-year-low

“We strongly urge the United States to immediately stop making irresponsible remarks on the issue of Xinjiang, stop interfering with China’s internal affairs and remove relevant Chinese entities from the Entity List as soon as possible,” said a ministry statement. “China will take all necessary measures to resolutely safeguard Chinese interests.”

The ministry gave no details of possible retaliation.

Despite the spike in tension, the ministry said Tuesday a trade delegation was going ahead with a trip to Washington this week for talks aimed at ending a tariff war.

The fight between China and the NBA has only become more fraught. All of the NBA’s official Chinese partners have suspended ties with the league after the Houston Rockets general manager tweeted support for the Hong Kong protests last weekend.

Meanwhile, NBA Commissioner Adam Silver said Tuesday that he won’t censor players or team owners over China or other issues. He argued that the league is motivated by much more than money, and freedom of expression must be protected.

The league doesn’t have great options, my CNN Business colleague Chris Isidore writes: “They can fire [Rockets general manager Daryl] Morey and apologize, which would be seen in America as putting profits ahead of free expression and caving to anti-democratic forces in China. Or they [can] stand behind him and risk losing the sport’s largest growth market.”

That tension has resurfaced questions about whether Western companies can operate in China while sticking to their values and keeping customers happy at home. It’s an issue that’s dogged US airlines, which have tweaked references to Taiwan to appease Beijing, and Google, which came under fire for developing a censored Chinese-language version of its search engine.

Consumers growing more worried about trade war – that’s bad news for US economy

Improved market access for US companies has been a goal of trade talks. But what happens when doing business in China exposes companies to the kind of trouble rocking the NBA? Facebook, which has been shut out of the country, might be breathing a sigh of relief.

It’s a tense environment for trade talks

The NBA battle is ostensibly separate from trade talks. But it doesn’t help the already tense environment ahead of high-level discussions in Washington on Thursday.

The scene: Earlier this week, the United States put 28 Chinese entities on a blacklist that effectively bars them from importing American technology over the groups’ alleged role in facilitating human rights abuses in China’s Xinjiang region. Then, on Tuesday, the Trump administration announced visa restrictions on Chinese officials suspected of being involved such abuses.

The spike in tensions sparked a late session selloff for US stocks on Tuesday. The S&P 500 finished down nearly 1.6%, while the Dow dropped 1.2%. The scare did not carry over to most Asian markets on Wednesday, however.

The fear: “Recent events surrounding US-China ties threaten to raise new points of conflict beyond just trade differences,” said FXTM market analyst Han Tan. “A wider scope in this protracted conflict would only heighten the barriers to a meaningful reconciliation between the world’s two economic powerhouses.”

Risk aversion should continue to be the name of the game. Watch safe haven assets, like gold and the Japanese yen.