WASHINGTON — For the White House holiday parties that began this week, the decor was a mix of holiday fantasy and pandemic reality. A toy train scooted around a table festooned with garlands while a masked military band played. Servers stood behind plexiglass to hand out filet mignon and white chocolate truffles to champagne-sipping guests.

President Trump made only a brief appearance, speaking from behind a lectern at the kind of indoor gathering that public health officials have warned could spread the deadly coronavirus, and after earlier White House events, held outdoors, sickened a number of attendees.

“It’s been an amazing four years. We are trying to do another four years. Otherwise, I’ll see you in four years,” he said, according to two people who attended the fete.

Trump is spending his final weeks in the White House much like he spent his first — indulging in delusions and spreading chaos.

He has threatened to veto the annual defense spending bill, which includes pay raises for troops and other essential funding, unless Congress includes an unrelated provision to pun-ish social media companies that he claims are biased against him. He’s planning a string of pardons even as newly unsealed court records reveal that federal authorities are investigating an alleged cash-for-pardons bribery scheme. He’s refusing to back down from his faltering attempts to overturn Joe Biden’s election victory, and reportedly considering firing his attorney general for not backing him up.

“He thinks that he won,” said a source close to Trump who requested anonymity to discuss private conversations. Trump’s unprecedented behavior as a lame-duck president is a final rebuttal to the persistent hopes of some supporters — and even some detractors — that he would grow into the world’s most powerful job. Instead he’s replaced the lies about the crowd size at his inauguration with lies about his votes for reelection, and this time undermined many Americans’ faith in the democratic process.

In a new broadside Wednesday, Trump uploaded a 46-minute video to Facebook in which he unspooled a series of debunked conspiracy theories about the election while standing behind a White House lectern affixed with the presidential seal.

“I am determined to protect our election system, which is under coordinated assault and siege,” he said.

He veered from grievance to grievance, revisiting old wounds from the Russia investigation and his impeachment in between his false allegations about rigged voting machines and fraudulent mail ballots. Trump said he was “prepared to accept any accurate election result,” but baselessly claimed Biden won only because of cheating.

“There is still plenty of time to certify the correct winner of the election, and that’s what we’re fighting to do,” he said.

The video was posted one day after Atty. Gen. William Barr, in a rare public break with the president, said there was no evidence that illegal voting determined the result. “To date, we have not seen fraud on a scale that could have effected a different outcome in the election,” Barr told the Associated Press.

Kayleigh McEnany, the White House press secretary, declined Wednesday to say whether Trump still had confidence in Barr. In a nod to his penchant for announcing firings on Twitter, Mc-Enany told reporters that “if the president has any personnel announcements, you’ll be the first to know it.”

McEnany attempted to gloss over Barr’s comments, saying he was referring only to criminal investigations, not the civil litigation that the president has been pursuing. However, almost all of Trump’s many lawsuits have failed. In his video, he claimed illogically that the federal judges who had ruled against him actually believed that he’d won the election.

The president has also failed in his efforts to persuade Republican state lawmakers in political battlegrounds won by Biden, including Michigan and Pennsylvania, to ignore their states’ votes and appoint pro-Trump electors to the electoral college on Dec. 14.

With few options available, Trump has begun calling into pseudo-hearings held by Republicans in several states to publicize far-fetched allegations of voter fraud.

“This is the greatest scam ever perpetrated on our country,” he said Monday to a group in Arizona, his voice transmitted from the phone of one of his lawyers, Jenna Ellis, who held it to a microphone.

Most Republicans have refused to speak out against Trump’s falsehoods, and he has feuded with the ones who have not assisted his attempts to overturn Biden’s win. He’s attacked Doug Ducey and Brian Kemp, the Republican governors of Arizona and Georgia, respectively, after they certified Biden’s victories in their states. And he ignored pleas from Gabriel Sterling, a GOP election official in Georgia, who said his conspiracy theories were inspiring violent threats. “Someone’s going to get killed,” Sterling said Tuesday, addressing his comments directly to the president.

Trump plainly was unmoved. “Rigged Election. Show signatures and envelopes. Expose the massive voter fraud in Georgia,” he tweeted even as he shared a video of Sterling’s remarks.

The president’s flailing through his final weeks in office has threatened to jeopardize military funding, which Congress has approved annually for the last 59 years in bipartisan votes.

The target of his anger is Section 230 of the Communications Decency Act, which limits website owners’ legal liability for content posted by users. Trump accuses social media companies of censoring him and other conservatives, and he called the provision “a serious threat to our National Security & Election Integrity.”

“Therefore, if the very dangerous & unfair Section 230 is not completely terminated as part of the National Defense Authorization Act (NDAA), I will be forced to unequivocally VETO the Bill when sent to the very beautiful Resolute desk. Take back America NOW. Thank you!” Trump tweeted on Tuesday night, using one of the same online platforms that he’s raged against.

Congressional leaders appear willing to call the president’s bluff and move the legislation forward anyway. Their stance reflects their confidence that a Trump veto probably would be easily overridden.

Sen. James M. Inhofe (R-Okla.), chairman of the Senate Armed Services Committee, said that he agrees with Trump about the internet matter but that the issue “has nothing to do with the military.”

“We ought to do away with 230,” he said. “But you can’t do it in this bill.”

Times staff writers Janet Hook and Eli Stokols contributed to this report.