President Trump made good Wednesday on his repeated threats to veto a $741 billion defense spending bill, setting up what is expected to be the first successful veto override of his presidency during his last weeks in office.

The impending rebuke, coming on the heels of his decisive election loss, threatens to end the White House tenure he promised would be full of “winning” instead in stinging defeat. The near-certainty that both the House and Senate will override Trump’s veto is also a harbinger of a similar fate awaiting the president if he tries to veto a pending bill to fund the government and address the coronavirus crisis, which he hinted this week he might do.

The House and Senate each passed the defense bill earlier this month with strong veto-proof majorities, rejecting Trump’s insistence that it be changed to meet his oftentimes shifting demands. Both chambers are expected to sustain the two-thirds majorities needed to override the president’s veto, despite pledges from House Minority Leader Kevin McCarthy (R-Calif.) and other stalwart Trump allies not to cross the president’s wishes.

In his veto message, Trump complained that the legislation includes “provisions that fail to respect our veterans’ and military’s history” — a seeming reference to instructions that the Defense Department change the names of installations commemorating Confederate leaders. He also scorned the bill as a “ ‘gift’ to China and Russia,” slammed the bill for restricting his ability to draw down the presence of U.S. troops in certain foreign outposts, and excoriated lawmakers for failing to include an unrelated repeal of a law granting liability protections to technology companies that Trump has accused, without significant evidence, of anti-conservative bias.

Congress has until Sunday, Jan. 3, at 11:59 a.m. to override the veto and force the defense bill to become law. If they do nothing, it will expire along with the end of the two-year congressional session at noon that day. The House is planning to reconvene on Monday to hold a veto override vote, while the Senate is expected back in Washington on Tuesday and will hold its veto override vote thereafter.

Sen. James M. Inhofe (R-Okla.), chairman of the Senate Armed Services Committee, urged members not to be swayed by the president’s resistance and vote to ensure the bill becomes law.

“The NDAA has become law every year for 59 years straight because it’s absolutely vital to our national security and our troops,” Inhofe said in a statement Wednesday. “This year must not be an exception.”

Meanwhile the president’s GOP critics dismissed his latest protest as the antics of a leader flailing upon his exit.

“He just wants to break stuff on the way out,” George Conway, a lawyer and adviser to the anti-Trump Lincoln Project, wrote in a tweet shortly after the president issued his veto.

Trump and his advisers have repeatedly objected to various provisions in the behemoth defense legislation, including its mandate to the Pentagon to rename the 10 military installations bearing titles that honor the Confederacy and the bill’s limitations on reducing troop levels in Germany, South Korea and Afghanistan.

Trump’s insistence that the defense bill become a vehicle for a repeal of Section 230 of the Communications Decency Act, which protects companies from bearing legal responsibility for content third parties post on their websites, became a breaking point between the president and congressional Republicans during the final days of negotiations over the legislation. Trump views its repeal as a way to punish social media companies like Facebook, Google and Twitter.

Democrats and Republicans have agreed that Section 230, which was written in 1996, is problematic. But GOP leaders willing to accommodate Trump elsewhere bristled at his threat to hold the entire Defense Department hostage over his war with the Internet giants.

The president, however, has not been mollified by his allies’ promises to tackle an overhaul of the legislation elsewhere.

Trump’s swipe at the bill’s response to China was a packaged insult to the bill’s authors, who included provisions to step up the U.S. cybersecurity and naval response to Beijing and inaugurated a Pacific Deterrence Initiative to bolster the security of American and allied interests in China’s backyard.

Trump has groused that the bill would nonetheless be a gift to China because it does not “allow for 5G,” as he recently tweeted. The legislation refrains from greenlighting a 5G development project by Ligado, a company that earlier this year secured permission from the Federal Communications Commission to build its proposed network using a portion of the radio frequency spectrum that the Pentagon says comes dangerously close to bandwidth used in sensitive satellite-dependent military operations and could compromise the reliability of GPS. The White House has also been pushing the Pentagon this year to approve a spectrum-leasing plan to develop a nationwide 5G network.

Trump and his advisers also objected to provisions in the bill that stand as a repudiation of other decisions he made as commander in chief. For instance, the bill contains a prohibition on shifting more than an annual $100 million in military construction funds to domestic projects by presidential emergency decree, a direct answer to Trump’s efforts to redirect billions toward his border wall project.