The billionaire businessman - who made his money in the property market - took the decision as part of the broader Defense Authorization Act, part of which relates to the US government and government contractors.
Some people within the government reportedly consider the firms to be a threat to national security.
The ban - which goes into effect over the next two years - relates to the use of Huawei and ZTE components or services that are considered "critical".
Some components from these two companies are still legal, but only on the condition that they cannot be used to access data.
Earlier this year, Trump blocked a planned takeover of chipmaker Qualcomm by Singapore-based Broadcom.
The President said he took the decision because he considers it to be a potential compromise of national security, suggesting that the much-discussed $140 billion (£100 billion) deal could lead to China pulling ahead in the 5G wireless race.
But Mario Morales - the vice-president of enabling technologies and semiconductors at research firm IDC - argued that the decision was motivated more by competitiveness than security concerns.
He explained: "Given the current political climate in the US and other regions around the world, everyone is taking a more conservative view on mergers and acquisitions and protecting their own domains."