The provision was supported by large numbers of both Republicans and Democrats in the Senate, who view ZTE as a national security threat. It also prohibits the federal government from purchasing or leasing equipment from ZTE or another Chinese company that they believe to be a national security threat, Huawei, or from subsidizing the companies in any way.

The defense bill, the National Defense Authorization Act, would authorize just over $700 billion in military spending for the coming fiscal year and is intended to provide a framework for the Trump administration’s continued buildup of the armed forces. The legislation outlines a range of stipulations, including strategic priorities for the military, pay increases for service members and investments in emerging technologies that policymakers believe could reshape the way the United States and other nations conduct warfare.

A far-reaching measure that is considered must-pass legislation, the annual defense bill is frequently a magnet for lawmakers trying to attach policy provisions only tangentially related to national security. In the Senate, this year’s bill provided a venue for Republican senators increasingly distraught with Mr. Trump’s protectionist trade policies to try to force his hand. Mostly, they failed.

Senate leaders blocked an amendment, advanced by Senator Bob Corker, Republican of Tennessee, that would have given Congress the power to veto certain national security tariffs imposed by the administration before it was ever brought up for a vote. The decision enraged Mr. Corker, who called his party’s deference to Mr. Trump “cultish,” but only after the machinations over the amendment all but eclipsed the defense policies in the bill.

Another Republican-proposed amendment that would have given Congress greater oversight of the agency that reviews proposed acquisitions of American companies by foreign firms — known as the Committee on Foreign Investment in the United States, or Cfius — failed in a floor vote Thursday. That amendment was opposed by the Trump administration, which said it could hamper the role of Cfius and put national security at risk.

But lawmakers did include a separate, bipartisan amendment that would give Cfius more power by expanding its reviews from focusing strictly on mergers and acquisitions to include joint ventures. Lawmakers have said the provision is aimed at Chinese companies that had been bypassing the Cfius review by forming joint ventures with American companies or licensing their technology.

The underlying defense legislation aims to build on the Pentagon’s national defense strategy unveiled in January. That document called for the United States to begin shifting its focus from the decades-long fight against terrorism to countering ascendant Russian and Chinese military might.