Congress has overridden President Donald Trump's veto of a defense policy bill, a first by lawmakers since he took office nearly four years ago.

In an extraordinary New Year's Day session, the Republican-controlled Senate easily turned aside the veto, dismissing Trump's objections to the $740 billion bill and handing him a stinging rebuke just weeks before his term ends.

Trump had lashed out at GOP lawmakers on Twitter, charging earlier this week that “Weak and tired Republican ‘leadership’ will allow the bad Defense Bill to pass.″

Trump called the looming override vote a “disgraceful act of cowardice and total submission by weak people to Big Tech. Negotiate a better Bill, or get better leaders, NOW!"

The 81-13 vote in the Senate followed an earlier 322-87 override vote in the House of the widely popular defense measure. The bill provides a 3% pay raise for U.S. troops and guides defense policy, cementing decisions about troop levels, new weapons systems and military readiness, personnel policy and other military goals. Many programs, including military construction, can only go into effect if the bill is approved.

Senate Majority Leader Mitch McConnell, R-Ky., said before the vote that Congress has passed the National Defense Authorization Act every year for 59 years in a row, "and one way or another, we are going to complete the 60th annual NDAA and pass it into law before this Congress concludes on Sunday.''

The bill "looks after our brave men and women who volunteer to wear the uniform,'' McConnell said. “But it’s also a tremendous opportunity: to direct our national security priorities to reflect the resolve of the American people and the evolving threats to their safety, at home and abroad. It’s our chance to ensure we keep pace with competitors like Russia and China.''

The Senate override was delayed after Sen. Bernie Sanders, I-Vt., objected to moving ahead until McConnell allowed a vote on a Trump-backed plan to increase COVID-19 relief payments to $2,000. McConnel did not allow that vote; instead he used his parliamentary power to set a vote limiting debate on the defense measure, overcoming a filibuster threat by Sanders and Senate Democratic leader Chuck Schumer of New York.

Without a bipartisan agreement, a vote on the bill could have been delayed until Saturday night. Lawmakers, however, agreed to an immediate roll call Friday once the filibuster threat was stopped.

Trump rejected the defense measure last week, saying it failed to limit social media companies he claimed were biased against him during his failed reelection campaign. Trump also opposed language that allows for the renaming of military bases that honor Confederate leaders.

Sen. Jim Inhofe, R-Okla., chairman of the Senate Armed Services Committee, said he was “disappointed” with Trump’s veto and called the bill “absolutely vital to our national security and our troops.″

“This is the most important bill we have,″ Inhofe said. “It puts members of the military first.″

Trump has succeeded throughout his four-year term in enforcing party discipline in Congress, with few Republicans willing to publicly oppose him. The bipartisan overrides on the defense bill showed the limits of Trump’s influence in the final weeks of his term.

Earlier this week, 130 House Republicans voted against the Trump-backed COVID relief checks, with many arguing they were unnecessary and would increase the federal budget deficit.

The Democratic-controlled House approved the larger payments, but the plan is dead in the Senate, another sign of Trump’s fading hold over Congress.

Besides his concerns about social media and military base names, Trump also said the defense bill restricted his ability to conduct foreign policy, “particularly my efforts to bring our troops home.″ Trump was referring to provisions in the bill that impose conditions on his plan to withdraw thousands of troops from Afghanistan and Germany. The measures require the Pentagon to submit reports certifying that the proposed withdrawals would not jeopardize U.S. national security.

Trump has vetoed eight other bills, but those were all sustained because supporters did not gain the two-thirds vote needed in each chamber for the bills to become law without Trump’s signature.

Rhode Island Sen. Jack Reed, the top Democrat on the Senate Armed Services Committee, called Trump's Dec. 23 veto a “parting gift" to Russian President Vladimir Putin "and a lump of coal for our troops. Donald Trump is showing more devotion to Confederate base names than to the men and women who defend our nation.″