Silicon Valley startup Pilot AI Labs Inc. signed a Chinese-backed venture-capital firm as its first big investor in 2015. By last summer, Pilot AI wanted it gone.

The U.S. startup hoped to sell more of its artificial-intelligence software to the U.S. government after working with the Pentagon, according to people familiar with its operations, and worried its effort could be hurt by the investor’s ties to China’s government. The chairman of the Chinese-backed investor, Digital Horizon Capital, was asked to sell back its stake, said one of the people. He angrily refused.

Chinese investors were once embraced in Silicon Valley both for their pocketbooks and their access to one of the world’s largest and trickiest markets. Today, they are suddenly less welcome.

Since late last year, amid rising U.S.-China tensions, venture firms with China ties have been dialing back their U.S. investments, structuring deals in novel ways to avoid regulators or shutting their U.S. offices. Some American venture firms are dumping their Chinese limited partners or walling them off with special structures. And some U.S. startups that have taken significant Chinese money are keeping the investments quiet or trying to push their Chinese investors out to avoid scrutiny.

After hitting record levels early last year, Chinese funding for U.S. startups slowed beginning in May 2018, according to research firm Rhodium Group. And state-backed Chinese investors all but disappeared by year-end, Rhodium said. Meanwhile, foreign direct investment from China, which includes acquisitions of U.S. companies, plunged 90% to $5 billion in 2018 from $46 billion in 2016.