President Barack Obama on Friday took the rare step of forbidding a foreign company from buying a firm with U.S. assets, telling a Chinese investment fund that it cannot complete a deal for German technology company Aixtron SE.

Mr. Obama’s move, only his second outright ban on a foreign acquisition, shows the increasing suspicion the U.S. harbors toward Chinese acquisitions of certain U.S. firms, even before the arrival of President-elect Donald Trump, who made criticism of Beijing a cornerstone of his campaign.

In...