President Donald Trump said he was working with Chinese President Xi Jinping to keep ZTE Corp. in business, throwing an extraordinary lifeline to the Chinese telecommunication giant that has been laid low by U.S. moves to cut off its suppliers.

The surprise intervention comes less than a month after ZTE was hit with an order banning U.S. companies from selling components to the Chinese business. The U.S. Commerce Department directed companies to stop exporting to ZTE in mid-April, saying the Chinese firm violated the terms...