President Donald Trump spent much of his Christmas Eve attacking his opponents and critics on Twitter, lashing out at everyone from Republican Sen. Bob Corker to the Federal Reserve.

Trump also attacked Democrats over the border-wall issue and went after James Mattis just days after he resigned as secretary of defense.

The president tweeted, "I am all alone (poor me) in the White House waiting for the Democrats to come back and make a deal on desperately needed Border Security."

From Sunday morning to 1 p.m. ET on Monday, the president tweeted 23 times.

President Donald Trump spent much of his Christmas Eve attacking his opponents and critics on Twitter, lashing out at everyone from Republican Sen. Bob Corker to the Federal Reserve.

The president tweeted: "I am all alone (poor me) in the White House waiting for the Democrats to come back and make a deal on desperately needed Border Security. At some point the Democrats not wanting to make a deal will cost our Country more money than the Border Wall we are all talking about. Crazy!"

Trump's marathon holiday tweetstorm began with criticism of Democrats for not giving into his demands for funding for a massive wall along the US-Mexico border. The president's fight with Democrats over this issue has led to a partial government shutdown.

"Virtually every Democrat we are dealing with today strongly supported a Border Wall or Fence," Trump tweeted. "It was only when I made it an important part of my campaign, because people and drugs were pouring into our Country unchecked, that they turned against it. Desperately needed!"

Read more: Alarmed traders are sending the S&P 500 to its biggest annual drop since 2008 — while Mnuchin's odd attempt to soothe markets backfired

The president then lashed out at senators who've questioned his foreign policy in relation to his attacks on traditional US allies. Trump routinely butts heads with NATO allies, for example, over the issue of defense spending.

Trump said members of the Senate who believe he doesn't "appreciate" being allied with other countries are wrong, adding that what he doesn't like is when countries "take advantage of their friendship with the United States."

He made these comments in relation Defense Secretary James Mattis' recent decision to step down, who appeared to rebuke Trump's treatment of allies in his resignation letter.

Trump tweeted: "We are substantially subsidizing the Militaries of many VERY rich countries all over the world, while at the same time these countries take total advantage of the U.S., and our TAXPAYERS, on Trade. General Mattis did not see this as a problem. I DO, and it is being fixed!"

The president also went after Brett McGurk, the top US official leading a 79-nation coalition fighting ISIS who resigned on Friday, and Republican Sen. Bob Corker.

Read more: Top US official leading fight against ISIS resigns with scathing letter calling Trump's Syria troop withdrawal a 'complete reversal' of US policy

Trump referred to the Tennessee senator, who's set to retire at the end of the year, as "Little Corker."

McGurk and Corker have both been critical of Trump's decision to withdraw US troops from Syria given the ongoing presence of ISIS in the region, among other concerns.

In another tweet, Trump also went after the Federal Reserve, which he's been critical of regarding rising interest rates and chaos in the stock market, describing it as "the only problem our economy has."

The president added: "They don’t have a feel for the Market, they don't understand necessary Trade Wars or Strong Dollars or even Democrat Shutdowns over Borders. The Fed is like a powerful golfer who can't score because he has no touch - he can't putt!"

The White House announced on Saturday that Trump is spending Christmas in Washington instead of at his private Mar-a-Lago club in Florida. First lady Melania Trump is returning from South Beach to spend the holiday with him.

From Sunday morning to 1 p.m. ET on Monday, the president tweeted 23 times.

The House Speaker-designate Nancy Pelosi and Senate Minority Leader Chuck Schumer slammed Trump over his behavior on Christmas Eve in a joint statement.

"It's Christmas Eve and President Trump is plunging the country into chaos," the statement said. "The stock market is tanking and the president is waging a personal war on the Federal Reserve – after he just fired the Secretary of Defense."

Read more: Dow drops 640 points for the worst Christmas Eve trading day on record

"Instead of bringing certainty into people’s lives, he’s continuing the Trump Shutdown just to please right-wing radio and TV hosts," the statement added. "Meanwhile, different people from the same White House are saying different things about what the president would accept or not accept to end his Trump Shutdown, making it impossible to know where they stand at any given moment."

Pelosi and Schumer said the president "wanted the shutdown," but added he doesn't seem to know "how to get himself out of it."