(Bloomberg) -- President Donald Trump on Wednesday vetoed the $740.5 billion U.S. defense policy bill after Congress refused to include language that would abolish liability protections for technology companies, including Facebook Inc. and Twitter Inc.

“Unfortunately, the Act fails to include critical national security measures, includes provisions that fail to respect our veterans and our military’s history, and contradicts efforts by my Administration to put America first in our national security and foreign policy actions,” Trump said in a statement.

He called the bill a “gift” to China and Russia.

The Republican-controlled Senate on Dec. 11 by a wide margin passed the measure, which provides for, among many other things, military pay raises and extra pay for troops assigned to dangerous missions. The vote was 84-13, which if sustained would be more than enough to hand Trump the first veto override of his presidency. So was the House vote earlier that week: 335 to 78.

Trump wanted to attach to the defense measure an unrelated provision to eliminate Section 230 of the Communications Decency Act, which protects technology companies from liability for most content published by their users. He repeatedly tweeted veto warnings if Congress did not make that part of the annual legislation.

Trump had also threatened to veto the legislation because it contained a provision for renaming military installations that honor Confederate generals.

The president and others on the right have long accused social media platforms of censoring conservatives, something that the technology giants deny. While lawmakers from both parties have called for modifying or even eliminating Section 230, even Trump allies said it was the wrong place and the wrong time to wage that battle.

The lopsided margins underscored the broad bipartisan support for the National Defense Authorization Act and indicated that Trump, in the closing days of his administration, had lost clout with congressional Republicans.

Even so, House Minority Leader Kevin McCarthy, a California Republican, said he would “not vote against the president’s veto” even though he had voted for the bill.

Senate Armed Services Chairman Jim Inhofe, an Oklahoma Republican, called the defense measure “the most important bill of the year.”

“In voting against it, you have to stop and think about those kids that are out there in harm’s way and the threats that they are facing on a regular basis,” Inhofe said on the Senate floor Friday. “This is a serious thing that’s out there, and I can’t imagine wanting to have to face these people in the field, in harm’s way and say, well, we didn’t pass a defense authorization bill.”

The bill would authorize $732 billion in discretionary spending for national defense, including $69 billion for overseas contingency operations. It also authorizes funding for 93 F-35 fighter jets built by Lockheed Martin Corp. after the Trump administration requested 79.

It also would back funding for the construction of two Virginia-class submarines a year, after the administration originally requested funding for only one to free up money for nuclear deterrence. It would provides contract authority for as many as two nuclear Columbia-class submarines made by General Dynamics Corp.

©2020 Bloomberg L.P.