By Anna Isaac and Xie Yu

U.S. stocks swung between small gains and losses Monday on concerns that escalating tensions between Washington and Beijing will hurt trade between the world's two largest economies.

The Dow Jones Industrial Average ticked up 16 points, or 0.1%, in morning trading. The S&P 500 was up 0.1%, while the Nasdaq Composite gained 0.4%.

Investors said sentiment was tempered after Bloomberg News reported Monday that China has ordered companies to temporarily halt imports of some U.S. farm goods including soybeans. Such a move could add to the friction between the two countries and sour the prospects for existing and new trade agreements. A trade war roiled markets for much of 2019 and ended only after both sides agreed to a phase-one deal and pledged to continue negotiations to address other hot-button issues.

Tensions between the two nations have climbed again in recent weeks with U.S. officials expressing anger over how China handled the coronavirus outbreak. President Trump on Friday opted to downgrade relations with Hong Kong, saying China's decision to impose a national security law was "absolutely smothering Hong Kong freedoms" and made it impossible for the U.S. to continue treating the city with a special status.

"If it is true China will buy less soybeans, it will increase the chances of escalation with the U.S.," said Seema Shah, chief strategist at Principal Global Investors. Such a move would suggest that "China is predicting the upcoming U.S. election means that President Trump's bark will be worse than his bite."

Investors largely seemed to discount the clashes between police and civilians in the U.S. as the worst civil unrest in decades erupted in American cities this weekend.

"Markets are assuming it won't last. We've seen this all before, going back to the civil protests in the 1960s," said Ian Shepherdson, chief economist at Pantheon Macroeconomics. "If cities go on to be closed down due to curfews and so on, then that would be disastrous for companies trying to reopen. Too soon to tell."

Drug maker Pfizer fell 7.4%, weighing on the Dow. The drug-maker said late Friday that it would stop a study of a potential breast cancer treatment.

In bond markets, the yield on the 10-year U.S. Treasury ticked up to 0.680%, from 0.650% Friday.

Overseas, the pan-continental Stoxx Europe 600 climbed 0.8%. Among the best performers in the index was Associated British Foods, owner of clothing retailer Primark. Its shares rose 9% after it said it would be opening stores in coming weeks in response to loosening government lockdowns.

In Asia, Hong Kong's benchmark stock index led the region's markets higher, signaling investors' relief that Mr. Trump had refrained from definitive steps targeting the city or mainland China. The city's Hang Seng Index surged 3.4%.

Mr. Trump said Friday that the decision to stop treating Hong Kong as semi-autonomous from Beijing would affect issues such as extradition arrangements, trade in certain high-technology products, and advice to U.S. travelers, but he stopped short of announcing specific actions.

His statement on Hong Kong wasn't perceived as overly negative, likely because it didn't contain concrete measures on the phase-one trade deal or on Hong Kong sanctions, said Martin Hennecke, Asia investment director with St. James's Place Wealth Management.

Hong Kong is to some extent benefiting from U.S.-China tensions, which has helped create strong demand for secondary listings from Chinese companies that are already listed in the U.S., Mr. Hennecke said.

Markets are boosted by relief that the U.S. hasn't taken tougher measures, which could potentially have devastated the Hong Kong economy and had wider regional effects, according to Alex Au, managing director at Alphalex Capital Management, a hedge fund based in Hong Kong.

"The short-term overhang is removed," Mr. Au said.

Write to Anna Isaac at anna.isaac@wsj.com and Xie Yu at Yu.Xie@wsj.com