Brendan Smialowski/AFP/Getty Images

President Donald Trump on Monday signed a $716 billion defense policy bill that weakened efforts to punish Chinese telecom giant ZTE for violating trade laws.

The bill, named for ailing Arizona Sen. John McCain, prohibits the US government and its contractors from buying certain telecommunications and video surveillance equipment from ZTE, Huawei and a handful of other Chinese communications companies. The ban covers components and services deemed "essential" or "critical" to any government system.

ZTE, the fourth-largest smartphone maker in the US, had been dealing with a Commerce Department denial order that prevented American businesses from selling hardware or services to the company. It followed the government's determination that ZTE violated terms of a 2017 settlement by failing to fire employees involved with illegally shipping US equipment to Iran and North Korea. The seven-year ban forced ZTE to shut down its "major operating activities."

ZTE seemingly had little hope of survival until Trump tweeted that he was pushing the Commerce Department to work with ZTE to remove the ban -- an unprecedented move by a US president to countermand one of his own departments. Members of Congress on both sides of the aisle criticized Trump's tweet as irresponsible, prompting him to defend his position with yet another tweet.

Some lawmakers had hoped to use the bill to reinstate tough penalties against ZTE, but the compromise bill removed a provision that would undo a deal the Commerce Department struck in June for ZTE to pay a $1 billion penalty to resume business with US suppliers. But lawmakers agreed to abandon that effort in late July.

The security of Huawei products has been questioned by US intelligence officials, who worry of alleged ties to the government in Beijing. AT&T and Verizon both dropped plans to sell Huawei phones amid those concerns.

Huawei called the inclusion of its products in the John S. McCain National Defense Authorization Act for Fiscal Year 2019 "ineffective, misguided and unconstitutional."

"It does nothing to identify real security risks or improve supply chain security, and will only serve to stifle innovation while increasing internet costs for US consumers and businesses," Huawei said in a statement. "We believe that the American people deserve equal access to the best possible connections and smart device options, and will keep working to make this happen."

ZTE didn't immediately respond to a request for comment.

Now playing: Watch this: ZTE gets a lifeline to resurrect its business

Follow the Money: This is how digital cash is changing the way we save, shop and work.

CNET Magazine: Check out a sample of the stories in CNET's newsstand edition.