The latest moves against Huawei and ZTE mean that American companies like Apple and Qualcomm could soon be caught in the crossfire — and they have a lot to lose. Apple, for example, sold $46.5 billion worth of iPhones and other products in mainland China, Taiwan and Hong Kong last year. That was about 20 percent of its total sales.

Wealthy Chinese consumers have gravitated toward Apple, and President Xi Jinping and the Communist Party still aim to keep the public happy. But there are limits to Apple’s leverage in the country.

“Beijing will not sit idly by,” said Paul Triolo, who leads global technology policy analysis at Eurasia Group, a geopolitical risk consultancy. “Chinese officials will likely pause to digest this move, and the series of other trade and investment moves coming at them in waves, before deciding how best to respond. It is likely to get ugly before it gets better.”

Beijing could use its broad cybersecurity laws to steal the core computer code of American companies operating in China, said Dean Garfield, head of the Information Technology Industry Council, a trade group that represents the largest American tech companies. The Chinese government also could walk back recent commitments to allow more financial and electronic payments services from Mastercard, Visa and JPMorgan Chase. Or it could simply restrict American companies’ ability to do business in China, he said.

For ZTE, this week’s sanctions are a nightmare come true. The company’s smartphones and network gear rely on American microchips and software, which means it could need to redesign as much as 90 percent of its product line.

ZTE and Google, which supplies the Android operating system in the Chinese company’s phones, are concerned that the ban may prevent ZTE from licensing the software, according to a person familiar with the discussions but not permitted to speak publicly on the matter. No conclusion has been reached yet, the person said.