HONG KONG—Investing in China has never been this perilous.

When global investors flocked to the country during its economic boom in the past decade, geopolitical risks were at the back of their minds. Such risks are now a top consideration for buyers of Chinese stocks, bonds and stakes in private companies—and are turning many people off investing in China.

Beijing’s relationship with Washington has been deteriorating, and the impact on China’s economy and financial markets has come into clear view this year.

This past summer, the U.S. restricted Americans from investing in Chinese companies in certain high-tech industries. The U.S. has also imposed export restrictions on advanced semiconductor chips that can be used to develop artificial intelligence and related manufacturing equipment, to limit their use by China’s military.

Chinese internet giant Alibaba in November shelved a plan to carve out its large cloud-computing division because Washington’s chip curbs could hamper the unit’s business activities. Alibaba lost about $20 billion in market value in a day, demonstrating how U.S.-China tensions can cause unexpected losses for investors.

International venture-capital and private-equity investors also have to tread extra carefully when assessing Chinese companies.

“For every deal we now look at geopolitical risk, regulatory risk even before we start properly evaluating the attractiveness of the business and the business model,” Alvin Lam, a Hong Kong-based operating partner at European private-equity firm CVC Capital Partners, said at the AVCJ Private Equity & Venture Forum in November.

“The bar for a China deal is very, very high. We can see that with our clients,” said Xuong Liu, co-leader of Alvarez & Marsal’s Asia global transaction advisory group, at the same conference. “Clearly there are certain sectors that are out of bounds.”

The economic and financial decoupling between the U.S. and China has intensified since 2021. American investors have been forced to sell shares in companies that the U.S. says are aiding China’s military. That led to the delisting of Chinese state-owned telecom carriers and energy companies from U.S. stock exchanges. Americans have also been barred from investing in other blacklisted Chinese companies.

Russia’s invasion of Ukraine last year, which resulted in wide-ranging sanctions on Russia and bans on investing in the country’s stocks and bonds, crystallized for investors the risks of being heavily exposed to China.

Beijing has long regarded Taiwan, a democratic self-ruled island, as part of China. Communist Party leaders have threatened to take control of Taiwan by force, raising the specter of an invasion or military conflict. Growing U.S. support for Taiwan has drawn Beijing’s ire this year.

“We’re all watching closely what happens with Taiwan,” said David Vaughn, chief investment officer for non-U.S. and global strategies at San Diego-based ClariVest Asset Management. He added he is also concerned about China’s property bust and weakening consumer confidence.

Vaughn said that if geopolitical tensions don’t improve, he expects international investors to reduce their holdings of Chinese securities further. He said one worry for investors is whether the companies they hold shares in could be hurt by export bans or other new rules.

There has been a recent exodus of foreign money from mainland China’s stock markets. Since August, international investors have pulled the equivalent of more than $24 billion from China A shares—which are listed in Shanghai or Shenzhen—via a trading link with Hong Kong. That is the largest and most sustained net outflow of foreign funds through the link since it was established in 2014, according to Wind Information data.

The outflows coincided with a bout of weak Chinese economic data. The MSCI China Index haslost 10% this year, and is on track for its third consecutive year of declines.

Market strategists at some major Wall Street banks say most of the hedge funds and active-fund managers that have sold off their China stockholdings are unlikely to return until there are significant improvements in the country’s growth outlook and U.S.-China relations.

Morgan Stanley strategists have warned investors of “sustained geopolitical complexity” in 2024 and an election year in both the U.S. and Taiwan.

Goldman Sachs said in a Nov. 12 report that under what it called a very harsh scenario, investors could sell $170 billion more in Chinese shares—if U.S. pension funds completely liquidate their China holdings due to policy and geopolitical reasons and active mutual funds and hedge funds revert to their lowest China allocations.

Si Fu, a China equity portfolio strategist at Goldman Sachs, said the market has already priced in the geopolitical concerns, and that a harsh scenario isn’t likely to occur.

“We do get some questions from clients asking if things get even worse considering the current situation, how much can they still sell?” she said, adding that there have recently been signs of improvement in the U.S.-China relationship and for China’s macroeconomic outlook.

President Biden recently met with Chinese leader Xi Jinping in California, where they agreed to begin a dialogue on the risks of AI and resume communications between the two countries’ militaries.

The investment board for the Thrift Savings Plan, which holds the retirement savings of U.S. federal employees and members of the uniformed services, recently said its large international stock fund will shift to tracking a global MSCI benchmark that excludes China and Hong Kong.

Its reasoning for the change was deeply rooted in geopolitics. A consultant to the investment board pointed to “investment restrictions on sensitive Chinese technology sectors, the delisting of Chinese companies and sanctions on Russian securities due to the Russia-Ukraine conflict,” and said such unforeseen events could cause stocks to decline in value when investors are forced to sell them.

It also said the recent technology-investing restrictions and bans on exports of U.S. technology could herald more curbs on investments in stocks in China and Hong Kong.

Teeja Boye, a portfolio manager at Arlington, Va.-based Sands Capital, said his firm’s emerging-markets growth strategy had 30% of its assets exposed to China in mid-2021, and has since dropped to about 17% as of the end of October.

“Unfortunately, China is going through short-term stress in real estate and declining productivity—and at the same time it’s having a worse relationship with one of the most powerful nations in the world,” Boye said. “The best we can hope for is for things not to get worse,” he added.

Write to Dave Sebastian at dave.sebastian@wsj.com